Skip to content

feat: add light/dark mode toggle to HTML report#832

Merged
sonukapoor merged 1 commit into
mainfrom
feature/html-report-light-mode
Jul 13, 2026
Merged

feat: add light/dark mode toggle to HTML report#832
sonukapoor merged 1 commit into
mainfrom
feature/html-report-light-mode

Conversation

@sonukapoor

Copy link
Copy Markdown
Collaborator

The --report HTML output was dark-mode only. This adds full light/dark mode support with OS detection and a manual toggle.

Changes to src/output/html-reporter.ts:

  • CSS custom properties for all color tokens (background, surface, text, borders, severity badges)
  • @media (prefers-color-scheme: light) override so the report respects the user's OS preference automatically
  • data-theme attribute on <html> for programmatic override
  • Sun/moon toggle button in the report header
  • Inline <script> reads localStorage and applies the saved theme before first paint, preventing flash of wrong theme
  • localStorage write on toggle persists the preference across report opens

Closes #831

@sonukapoor sonukapoor added the enhancement New feature or request label Jul 13, 2026
@sonukapoor sonukapoor merged commit 580b585 into main Jul 13, 2026
6 checks passed
@sonukapoor sonukapoor deleted the feature/html-report-light-mode branch July 13, 2026 12:23
sonukapoor added a commit that referenced this pull request Jul 14, 2026
Add light/dark mode toggle (#832), Node 24 runner update (#825),
docs PRs (#769, #800, #801, #807, #810, #811), and regression
fixtures (#793, #794) that were merged but not tracked.
@sonukapoor sonukapoor mentioned this pull request Jul 14, 2026
sonukapoor added a commit that referenced this pull request Jul 14, 2026
* release: v1.27.0

Bump version to 1.27.0, update CHANGELOG and docusaurus latestVersion.

* release: add missing entries to v1.27.0 CHANGELOG

Add light/dark mode toggle (#832), Node 24 runner update (#825),
docs PRs (#769, #800, #801, #807, #810, #811), and regression
fixtures (#793, #794) that were merged but not tracked.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add light/dark mode toggle to HTML report

1 participant