Last active
April 29, 2024 09:33
-
-
Save captainbrosset/cfb9fe93005d9c25437af2c3a8954ef0 to your computer and use it in GitHub Desktop.
Backward compatible high-contrast/forced-colors mode
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
@media (-ms-high-contrast: active), (forced-colors: active) { | |
/* Your general contrast theme styles */ | |
} | |
@media (-ms-high-contrast: black-on-white), (forced-colors: active) and (prefers-color-scheme: light) { | |
/* Your specific light contrast theme styles */ | |
} | |
@media (-ms-high-contrast: white-on-black), (forced-colors: active) and (prefers-color-scheme: dark) { | |
/* Your specific dark contrast theme styles */ | |
} | |
/* For elements that need to opt-out of contrast theme styles */ | |
.opt-out-of-high-contrast { | |
-ms-high-contrast-adjust: none; | |
forced-color-adjust: none | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment