Repository navigation
Let ancestors theme the workspace, and follow the page's colour scheme (0.4.0) - #1
Merged
Merged
Conversation
The colour defaults were declared on .mp-workspace itself, so a theme set on an ancestor never reached the workspace, despite the stylesheet and README saying it could. The workspace also forced `color-scheme: light dark`, so light-dark() inside it, the host app's own tokens included, followed the system setting rather than the page's theme: an app in light mode on a dark system got a dark tab strip. Move the defaults to `:where(:root)`, where a value on the workspace or any ancestor wins, and stop setting color-scheme so the page decides. Derive the drop highlight where it is used so it follows an overridden accent. Pages that relied on the workspace following the system unstyled now need `color-scheme: light dark` on the root; the demo sets 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.
The colour defaults were declared on
.mp-workspaceitself, so a theme set on an ancestor never reached the workspace, though the stylesheet and README said it could. The workspace also forcedcolor-scheme: light dark, solight-dark()inside it (the host app's own tokens included) followed the system setting instead of the page's theme. The mdbase Editor in light mode on a dark system showed a dark tab strip with a near-invisible active tab title.:where(:root)(no specificity), so a value on the workspace or any ancestor wins.color-scheme; the page decides. The README says how to follow the system, and the demo does.--mp-accent.Breaking for pages that relied on the workspace following the system unstyled, hence 0.4.0.
Checked: typecheck, 53 tests and build pass. Rendered in headless Chrome against the Editor's tokens and stylesheet, for Editor light/dark × system light/dark: all four now follow the Editor's theme.