feat(#3873): add dark mode styles to AppHeader, Dropdown, WorkSideMenu, and body#3874
Draft
feat(#3873): add dark mode styles to AppHeader, Dropdown, WorkSideMenu, and body#3874
Conversation
f6d7723 to
d3c0858
Compare
ecb080a to
4cd14d1
Compare
…vice Co-authored-by: Thomas Jeffery <thomaswjeffery@gmail.com>
4cd14d1 to
c0ee586
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four small Svelte changes so dark mode can target colours that are currently hardcoded.
Changes
reset.css body background. Changed
#fffto reference--goa-color-greyscale-white.Dropdown native chevron. Replaced the pseudo-element chevron (hardcoded
#333stroke) with an inline SVG that follows--goa-dropdown-color-text. Same size and position as before.WorkSideMenu account popover background. Added
--goa-work-side-menu-account-bgso dark mode can give the popover its own background. Token is added in the design-tokens package in feat(#3873): add work-side-menu-account-bg token design-tokens#154.AppHeader and WorkSideMenu logos. Added dark variant SVGs and a MutationObserver on the
data-themeattribute so logos swap between light and dark when the theme changes.Note on the logo pattern
The logos use JS (a MutationObserver on the
data-themeattribute) to swap the<img src>between light and dark variants. The rest of the dark mode story is pure CSS cascade. This inconsistency is intentional for now: multi-colour branded imagery doesn't convert cleanly tocurrentColor-based inline SVG, and a proper refactor would be significantly larger. Happy to discuss a cleaner pattern in a follow-up if the team prefers.Context
Companion to #3850 (dark mode spike). The spike covered most of dark mode through token overrides. These changes address the shadow-DOM gaps the cascade can't reach.
How to test
npm installnpx nx serve react-prsdocument.documentElement.setAttribute('data-theme', 'dark'). AppHeader and WorkSideMenu logos swap. Run with'light'to swap back.Fixes #3873