Skip to content

Icons disappear in Windows High Contrast Mode #1130

@knowler

Description

@knowler

Currently when viewing with Windows High Contrast Mode (WHCM) enabled almost none of the icons show up. This is because WHCM overrides the colours.

npmx.dev running in Edge with Windows High Contrast Mode enabled. The app is in the package view for nuxt and all over none of the icons for buttons and other UI elements are displayed. npmx.dev running in Microsoft Edge with Windows High Contrast Mode enabled.

The icon classes all seem to use color: inherit, so we can use forced-color-adjust: preserve-parent-color. We can provide this to the extraProperties option for the icons preset in the UnoCSS config:

npmx.dev/uno.config.ts

Lines 24 to 26 in 3cf7fef

extraProperties: {
display: 'inline-block',
},

If you don’t have Windows, you can emulate forced colors in Chromium-browsers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a11yRelated to accessibility and inclusionfrontFrontend, Designgood first issueGood for newcomers

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions