Skip to content

feat(revamp): phase 4 — deps, Tailwind v4 CSS migration, theme switcher#119

Merged
hanihusam merged 3 commits into
stagingfrom
refactor-theme
May 19, 2026
Merged

feat(revamp): phase 4 — deps, Tailwind v4 CSS migration, theme switcher#119
hanihusam merged 3 commits into
stagingfrom
refactor-theme

Conversation

@hanihusam

Copy link
Copy Markdown
Owner

Summary

  • Dependency upgrades: react-router v7, react/react-dom v19, TypeScript, ESLint, Vitest, Vite, and all related type packages
  • Tailwind v4 CSS migration: Delete tailwind.config.ts; rewrite prose.css with plain CSS selectors (.prose.prose-light / .dark .dark\:prose-dark) following a CSS-first approach; remove @tailwindcss/aspect-ratio plugin and migrate to native aspect-[w/h] syntax
  • Theme system overhaul: Replace theme-provider.tsx with a new client hints system (client-hints.tsx, request-info.ts, theme.tsx) for OS-preference-aware theme detection on first visit; add ThemeSwitcher component with icon animation driven by the .dark class instead of hover; simplify toggle cycle to direct dark↔light with no "system" intermediate step
  • Bug fixes: Fix H5/H6 typography imports replaced with H4 across blog components

Test plan

  • Verify dev server starts without errors (npm run dev)
  • Confirm light/dark toggle switches in one click from either direction
  • Confirm first-time visitor with OS set to dark sees dark mode correctly
  • Check prose typography renders correctly on blog/writing pages in both themes
  • Run typecheck (npm run typecheck)
  • Run unit tests (npm run test)

hanihusam added 3 commits May 19, 2026 11:11
Packages upgraded:
- react-router + @react-router/* 7.13.0 → 7.15.1
- react + react-dom 19.2.4 → 19.2.6
- @types/react + @types/react-dom (latest)
- @vitejs/plugin-react 4.7.0 → 6.0.2
- @headlessui/react 2.2.9 → 2.2.10
- eslint 9 → 10, typescript 5 → 6, vitest 3 → 4
- @tailwindcss/typography (latest), removed @tailwindcss/aspect-ratio

Fixes:
- Replace non-existent H5/H6 with H4 in blog-title and writing slug route
- Convert aspect-h/w plugin classes to native Tailwind v4 aspect-[3/4] / aspect-[3/2]

Typography migration (v4 approach):
- Register plugin via @plugin directive in tailwind.css
- Migrate prose-light / prose-dark color modifiers from JS config to
  @Utility with --tw-prose-* CSS variables (v4-native approach)
- Keep structural DEFAULT overrides (grid, spacing, font sizes) in
  tailwind.config.ts via @config directive
…nfig.ts

Move all typography plugin customization out of tailwind.config.ts and
into prose.css as plain CSS selectors (Kent C. Dodds approach):

- Structural overrides (grid layout, spacing, font sizes) now live as
  .prose * rules at the top of prose.css — hard-coded values, no theme()
- Light mode colors use .prose.prose-light compound selectors
- Dark mode colors use .dark .dark\:prose-dark escaped selectors —
  plain CSS targeting the literal class name, no Tailwind utility needed
- Remove @Utility prose-light / prose-dark and @config directive from
  tailwind.css; only @plugin "@tailwindcss/typography" remains
- Delete tailwind.config.ts entirely — prose.css is now the single
  source of truth for all prose styling
- Upgrade react-router v7, react/react-dom v19, typescript, eslint,
  vitest, vite, and related type packages
- Delete tailwind.config.ts; migrate prose customization to plain CSS
  in prose.css following a CSS-first approach
- Remove @tailwindcss/aspect-ratio; migrate to native Tailwind v4
  aspect-[w/h] syntax
- Add client hints system (client-hints.tsx, request-info.ts, theme.tsx)
  for OS-preference-aware theme detection
- Remove theme-provider.tsx in favour of the new client hints approach
- Add ThemeSwitcher with icon animation driven by .dark class
- Fix theme toggle: remove "system" cycle so dark/light toggle in one click
- Fix H5/H6 typography imports replaced with H4 across blog components
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@hanihusam hanihusam merged commit 3f14982 into staging May 19, 2026
2 of 3 checks passed
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