Skip to content

fix(theme): revert prefers-color-scheme detection; dark is unconditio…#116

Merged
sinduri-g merged 3 commits into
mainfrom
fix/theme-dark-default
Jun 6, 2026
Merged

fix(theme): revert prefers-color-scheme detection; dark is unconditio…#116
sinduri-g merged 3 commits into
mainfrom
fix/theme-dark-default

Conversation

@sinduri-g
Copy link
Copy Markdown
Contributor

@sinduri-g sinduri-g commented Jun 6, 2026

…nal default

  • Remove OS-level prefers-color-scheme detection from useTheme.tsx and the inline themeScript in root.tsx
  • New visitors with no stored preference always get dark mode; light mode is only restored when localStorage explicitly holds "light"
  • Fixes PageSpeed Insights auditing in light mode (headless Chrome reports prefers-color-scheme: light, so the removed branch was switching it)
  • Update styleguide.md to document dark as the unconditional default

Type of change

  • feat new feature
  • fix bug fix
  • refactor no behavior change
  • docs / chore / config / perf / style / security

Manual checks

  • Screen reader tested (UI changes only)
  • New routes added to sitemap.xml, prerender array, README (routes only)

sinduri-g added 2 commits June 6, 2026 19:12
…nal default

- Remove OS-level prefers-color-scheme detection from useTheme.tsx and
  the inline themeScript in root.tsx
- New visitors with no stored preference always get dark mode; light mode
  is only restored when localStorage explicitly holds "light"
- Fixes PageSpeed Insights auditing in light mode (headless Chrome reports
  prefers-color-scheme: light, so the removed branch was switching it)
- Update styleguide.md to document dark as the unconditional default

Signed-off-by: Sinduri Guntupalli <sinduri.guntupalli@dynatrace.com>
…hicLayoutEffect

The guard was dead code: in SSR useIsomorphicLayoutEffect resolves to
useEffect, and React never runs effect callbacks during SSR, so the
body was never reached on the server. In the browser window is always
defined so the check always evaluated to false.

Update styleguide.md to document the correct pattern (try/catch for
fallible browser APIs) and explain why no typeof window guard is needed.

Signed-off-by: Sinduri Guntupalli <sinduri.guntupalli@dynatrace.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 6, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-06 17:34 UTC

- Correct refresh cadence from "daily" to "hourly" in useDiscussionPosts and useAdventureLeaderboard (both refreshed by the same hourly workflow)
- Extend useDiscussionPosts @returns to include solvers and loaded fields
- Fix WalkthroughStep.content description: pre-rendered HTML, not raw markdown
- Update TopPlayer and AdventureLevel.solvedCount/topPlayers comments: CommunitySidebar already uses real hook data; these fields are unused
- Replace misleading Tailwind content-scanner rationale in MarkdownContent with the accurate reason (module-level constants, created once)
- Remove false "kept in sync" claim in root.tsx; JSON-LD description and BRAND_SHORT_DESCRIPTION are intentionally separate
- Add matchMedia regression tests to useTheme.test.tsx

Signed-off-by: Sinduri Guntupalli <sinduri.guntupalli@dynatrace.com>
@sinduri-g sinduri-g merged commit c3cfed4 into main Jun 6, 2026
5 checks passed
@sinduri-g sinduri-g deleted the fix/theme-dark-default branch June 6, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant