-
-
Notifications
You must be signed in to change notification settings - Fork 424
fix: icons disappear in Windows High Contrast Mode #1150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
a3a5b37
8511430
794ab2c
714b511
e1d81d5
00bbd51
b562f5b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,6 +155,62 @@ | |
| } | ||
| } | ||
|
|
||
| /* Keep icon masks visible when Windows forced colors overrides theme tokens. */ | ||
| @media (forced-colors: active) { | ||
| :where([class^='i-'], [class*=' i-']) { | ||
| forced-color-adjust: none; | ||
| color: CanvasText; | ||
| } | ||
|
|
||
| /* Settings page: keep accent/background radio swatches visible in forced colors. */ | ||
| :where( | ||
| fieldset:has(input[type='radio'][name='accent-color']), | ||
| fieldset:has(input[type='radio'][name='background-theme']) | ||
| ) | ||
| > label { | ||
| forced-color-adjust: none; | ||
| border: 1px solid CanvasText; | ||
| } | ||
|
|
||
| :where( | ||
| fieldset:has(input[type='radio'][name='accent-color']), | ||
| fieldset:has(input[type='radio'][name='background-theme']) | ||
| ) | ||
| > label:has(> input:checked) { | ||
| outline: 2px solid Highlight; | ||
| outline-offset: 2px; | ||
| } | ||
|
|
||
| /* Settings page: make toggle tracks and thumb visible in forced colors. */ | ||
| button[role='switch'] > span:last-of-type { | ||
| forced-color-adjust: none; | ||
| } | ||
|
|
||
| button[role='switch'][aria-checked='false'] > span:last-of-type { | ||
| background: Canvas; | ||
| border-color: CanvasText; | ||
| } | ||
|
|
||
| button[role='switch'][aria-checked='false'] > span:last-of-type > span { | ||
| background: CanvasText; | ||
| } | ||
|
|
||
| button[role='switch'][aria-checked='true'] > span:last-of-type { | ||
| background: Highlight; | ||
| border-color: Highlight; | ||
| } | ||
|
|
||
| button[role='switch'][aria-checked='true'] > span:last-of-type > span { | ||
| background: HighlightText; | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit pick: css does support nesting now, I do think this could be nested down.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to use CSS nesting in the components. Thanks for the suggestion!'❤️ |
||
|
|
||
| /* Homepage tag dots are custom spans, not list markers. */ | ||
| :where([class~='bg-accent'][class~='rounded-full'][class~='w-1'][class~='h-1']) { | ||
| forced-color-adjust: none; | ||
| background: CanvasText; | ||
| } | ||
| } | ||
|
|
||
| html { | ||
| -webkit-font-smoothing: antialiased; | ||
| -moz-osx-font-smoothing: grayscale; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@userquin This overrides the effect of
forced-color-adjust: preserve-parent-colorthat is being applied with the UnoConfig. Which do you think is better?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, sorry, I didn't see this comment: that's why I use icon class in the selector (check my comment in linked issue), if not present I add the corresponding colors