Skip to content

Conversation

@Alain-L
Copy link

@Alain-L Alain-L commented Dec 12, 2025

Summary

  • Add dark mode support with toggle button, localStorage persistence, and system preference detection
  • Refactor SCSS to use CSS custom properties for runtime theme switching
  • Add visual regression tests with Playwright (22 tests covering light and dark modes)
  • Ensure WCAG AA contrast compliance for accessibility

Features

  • 🌙 Toggle button in navbar (sun/moon icons)
  • 💾 Theme preference persisted in localStorage
  • 🖥️ Respects system prefers-color-scheme on first visit
  • ♿ All text meets WCAG AA contrast ratios (≥4.5:1)

Technical details

  • CSS custom properties defined in _css-variables.scss with light/dark palettes
  • useTheme composable handles theme state and DOM updates
  • Bootstrap dark mode synced via data-bs-theme attribute
  • Dark mode overrides in separate dark-mode.css (loaded after Bootstrap)

Test plan

  • Unit tests pass (159 tests)
  • Visual regression tests pass (22 tests)
  • Lint passes
  • Manual testing: toggle works, preference persists across refresh
  • Manual testing: system preference detection on fresh browser

alesage added 11 commits December 11, 2025 10:37
- Add Playwright for screenshot-based visual testing
- Create e2e tests covering Plan, Grid, Raw, Stats tabs
- Add test:e2e and test:e2e:update npm scripts
- Add commit-msg hook to enforce commit message policy
- Exclude e2e/ from vitest
Prepare codebase for dark mode by centralizing color definitions:
- Remove duplicate $bg-color definition
- Replace #fff/white with $white
- Replace black with $gray-darkest
- Add $cte-color and $cte-border-color variables
- Replace inline colors in Plan.vue with CSS classes
- Make AnimatedEdge strokeColor prop optional
- Convert Grid.vue style to SCSS with variable
Prepare for dark mode by using native CSS variables:
- Add _css-variables.scss with --color-xxx definitions
- Replace SCSS $variables with var(--color-xxx) in stylesheets
- CSS custom properties can be changed at runtime for theming
- Add dark color palette to CSS custom properties
- Create useTheme composable with localStorage persistence
- Add system preference detection (prefers-color-scheme)
- Add toggle button in navbar (sun/moon icons)
- Sync with Bootstrap 5 dark mode (data-bs-theme)
- Add Bootstrap overrides for dark mode styling
- Style Tippy.js tooltips for dark mode
- Add visual regression tests for dark mode
Lighten hljs-comment from #8a8a9a to #9a9aaa to meet the 4.5:1
contrast ratio requirement for normal text (now ~5.0:1).
Replace (window as any) with properly typed Window interface
to satisfy TypeScript no-explicit-any rule.
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