fix(elements): respect explicit light class over os theme in persona - #468
Open
ephraimduncan wants to merge 1 commit into
Open
fix(elements): respect explicit light class over os theme in persona#468ephraimduncan wants to merge 1 commit into
ephraimduncan wants to merge 1 commit into
Conversation
Contributor
|
@ephraimduncan is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
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.
On a dark-OS machine, an app that forces light mode with
<html class="light">could render a completely invisible Persona: dynamic-color variants (command, glint, halo, obsidian) painted the avatar white on a white page. Theme detection recognized an explicit.darkclass but fell through to the OS media query when.lightwas set, so the OS preference silently overrode the app's choice — and the MutationObserver re-ran the same wrong precedence on every class change.Explicit
light/darkroot classes now win in either direction; the media query applies only when neither class is present, and the SSR default remains light. Added regression tests for both explicit-class × OS-preference combinations plus the no-class media-query fallback; the light-class case fails without the fix (setRgb(255,255,255)instead of(0,0,0)).