feat(theme): modular CSS, light/dark/auto theme system (Phase 1 - Foundation PR 1)#377
feat(theme): modular CSS, light/dark/auto theme system (Phase 1 - Foundation PR 1)#377vitorvasc wants to merge 38 commits intoopen-telemetry:mainfrom
Conversation
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
…ve documentation Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
…n themes.ts Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
…tence and auto mode Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
…cript to head Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
… documents Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
…ary/secondary swap Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
✅ Deploy Preview for otel-ecosystem-explorer ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
|
Code review using Gemini 3: Code reviewI've completed a thorough review of the feat/84-pr1-theme-system branch. 1. Correctness: Stale State in "Auto" ModeI identified a bug in Scenario:
Recommended Fix: Sync the state immediately when entering useEffect(() => {
if (mode !== 'auto') return;
const mql = window.matchMedia('(prefers-color-scheme: dark)');
// Sync immediately upon entering auto mode
setSystemTheme(mql.matches ? 'dark' : 'light');
const handler = (e: MediaQueryListEvent) => {
setSystemTheme(e.matches ? 'dark' : 'light');
};
mql.addEventListener('change', handler);
return () => mql.removeEventListener('change', handler);
}, [mode]);2. Correctness: Persistence Alias for
|
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
eca689d to
1bb6c52
Compare
Signed-off-by: Vitor Vasconcellos <vvasconcellos1@gmail.com>
Part of the Phase 1 foundation work for the explorer redesign (#84).
Contributes to #370.
What's in this PR
src/index.cssinto focused partials undersrc/styles/:tokens.css— all CSS custom properties (dark + new light theme block)base.css— global resets and body defaultssyntax.css— code block / syntax highlight rulesindex.css— entry point that@imports the partialssrc/main.tsxnow imports fromsrc/styles/index.css.{ themeId, setThemeId }API with a cleaner{ mode, resolved, setMode }shape:mode— the user's stored preference:"light" | "dark" | "auto"resolved— the value actually applied to the document ("light" | "dark")setMode— writes tolocalStorage["td-color-theme"]and updates[data-theme]on<html><script>inindex.htmlthat runs before first paint, readslocalStorage["td-color-theme"], and sets[data-theme]on<html>. Prevents the white flash users see on dark-preferred systems before React hydrates.[data-theme="light"]block intokens.cssalongside the existing dark defaults. Reconciles the five remaining dark surface tokens (card,muted,border, and variants) to the navy palette.<ThemeToggle />component (cycleslight → dark → auto). Not yet rendered.primary = blue / secondary = orangerealignment already onmainV1_REDESIGNgate):card,card-secondary,muted,muted-foreground,border) shift to the navy palette on merge.What's not in this PR
NavBar.V1_REDESIGNinApp.tsx.Verification
bun run test— 781 tests passtsc -b— cleantd-color-themeupdates. Reload; confirm the selected theme is applied before React loads (no flash).auto; confirm the page updates without a reload.