Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions app/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Copy link
Copy Markdown
Member

@knowler knowler Feb 7, 2026

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-color that is being applied with the UnoConfig. Which do you think is better?

Copy link
Copy Markdown
Member

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


/* 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;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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;
Expand Down
3 changes: 2 additions & 1 deletion uno.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export default defineConfig({
presetWind4(),
presetIcons({
extraProperties: {
display: 'inline-block',
'display': 'inline-block',
'forced-color-adjust': 'preserve-parent-color',
},
warn: true,
scale: 1.2,
Expand Down
Loading