Honor theme="light" over prefers-color-scheme: dark#3000
Draft
reteps wants to merge 11 commits intoarnog:masterfrom
Draft
Honor theme="light" over prefers-color-scheme: dark#3000reteps wants to merge 11 commits intoarnog:masterfrom
theme="light" over prefers-color-scheme: dark#3000reteps wants to merge 11 commits intoarnog:masterfrom
Conversation
Scope the `@media (prefers-color-scheme: dark)` blocks under `:host(:not([theme='light']))` so an author-set `theme="light"` on a `<math-field>` takes precedence over the OS-level dark preference. Previously, only `[theme='dark']` had an explicit CSS counterpart; a `theme="light"` attribute was a no-op on dark systems because the dark media query kept matching the bare `:host`/`.ML__container` selectors. Fixes arnog#2999. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the mirrored dark-theme blocks with a `color-scheme: light dark` default on :host and `light-dark()` per variable. `:host([theme='light'])` and `:host([theme='dark'])` pin the computed color-scheme so the attribute wins over `prefers-color-scheme` without duplicate declarations or double-negative selectors. The sole remaining attribute+media-query override is `--_smart-fence-opacity`, which is a <number> and therefore can't ride light-dark(). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
A review pass revealed several variables in the master dark-mode block that used different user-override names than their light-mode counterparts, or that had no user-override hook at all in dark mode. The first light-dark() draft silently consolidated these, which would change observable behavior for consumers setting the affected custom properties. - --_text-highlight-background-color: preserve dual hooks (--highlight-text in light, --text-highlight-background-color in dark) - --_latex-color: preserve dark's --primary-only hook (don't upgrade --latex-color to higher priority in dark) - --_placeholder-color, --_composition-background-color, --_composition-text-color: preserve hardcoded dark values (no user hook) Also restore a trailing-space diff artifact in ui/style.less. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…churn Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Restores specificity headroom for the forced-colors block in mathfield.less and the :lang/:dir overrides in ui/style.less. The earlier selector-list form (`.ML__container, :host([theme='light']) .ML__container`) raised the base rule above those later overrides, so theme='light' + forced-colors or theme='light' + :lang(ja)/:dir(rtl) stopped reaching their overrides. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Unifies the theme='light' escape hatch across all three theme stylesheets so the codebase has one pattern, not two. Also drops issue-number references from the accompanying comments. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
theme="light" over prefers-color-scheme: dark
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Fixes #2999:
theme="light"on<math-field>had no effect when the OS reportsprefers-color-scheme: darkAlternatives considered:
light-dark-- low browesr support: https://caniuse.com/?search=light-dark:host, :host([theme='light'])style pattern -- more complex specificity rules@layercss approachTesting
Test suite added to verify fix.
🤖 Generated with Claude Code