Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
20 changes: 20 additions & 0 deletions app/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,26 @@
}
}

/*
* Forced Colors Mode (WHCM) Override for Icons
*
* By default, `forced-color-adjust: preserve-parent-color` (from UnoConfig) works fine
* for most icons as they inherit the correct text color.
*
* However, if icons disappear in specific contexts (e.g., inside buttons with
* complex backgrounds or transparent states), uncomment the following block
* to enforce visibility using `CanvasText`.
*/
/*
@media (forced-colors: active) {
[class^='i-'],
[class*=' i-'] {
forced-color-adjust: none !important;
color: CanvasText !important;
}
}
*/

html {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand Down
15 changes: 15 additions & 0 deletions app/components/Settings/AccentColorPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,18 @@ onPrehydrate(el => {
</label>
</fieldset>
</template>

<style scoped>
@media (forced-colors: active) {
/* keep accent radio swatches visible in forced colors. */
label {
forced-color-adjust: none;
border: 1px solid CanvasText;

&:has(> input:checked) {
outline: 2px solid Highlight;
outline-offset: 2px;
}
}
}
</style>
15 changes: 15 additions & 0 deletions app/components/Settings/BgThemePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,18 @@ onPrehydrate(el => {
</label>
</fieldset>
</template>

<style scoped>
@media (forced-colors: active) {
/* keep background theme swatches visible in forced colors. */
label {
forced-color-adjust: none;
border: 1px solid CanvasText;

&:has(> input:checked) {
outline: 2px solid Highlight;
outline-offset: 2px;
}
}
}
</style>
27 changes: 27 additions & 0 deletions app/components/Settings/Toggle.client.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,31 @@ button[aria-checked='true'] > span:last-of-type > span {
html[dir='rtl'] button[aria-checked='true'] > span:last-of-type > span {
translate: calc(-100%);
}

@media (forced-colors: active) {
/* make toggle tracks and thumb visible in forced colors. */
button[role='switch'] {
& > span:last-of-type {
forced-color-adjust: none;
}

&[aria-checked='false'] > span:last-of-type {
background: Canvas;
border-color: CanvasText;

& > span {
background: CanvasText;
}
}

&[aria-checked='true'] > span:last-of-type {
background: Highlight;
border-color: Highlight;

& > span {
background: HighlightText;
}
}
}
}
</style>
12 changes: 11 additions & 1 deletion app/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ defineOgImageComponent('Default', {
<li v-for="framework in SHOWCASED_FRAMEWORKS" :key="framework.name">
<LinkBase :to="packageRoute(framework.package)" class="gap-2 text-sm">
<span
class="w-1 h-1 rounded-full bg-accent group-hover:bg-fg transition-colors duration-200"
class="home-tag-dot w-1 h-1 rounded-full bg-accent group-hover:bg-fg transition-colors duration-200"
/>
{{ framework.name }}
</LinkBase>
Expand All @@ -139,3 +139,13 @@ defineOgImageComponent('Default', {
</section>
</main>
</template>

<style scoped>
/* Windows High Contrast Mode support */
@media (forced-colors: active) {
.home-tag-dot {
forced-color-adjust: none;
background-color: CanvasText;
}
}
</style>
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