<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/accessible-svgs-in-high-contrast-mode-hi7h96dcb" -->

---
title: Accessible SVGs in High Contrast Mode | daily.dev
description: Explains how to make SVG icons accessible in Windows High Contrast Mode using CSS media queries rather than JavaScript. Covers the -ms-high-contrast media...
canonical: https://daily.dev/posts/accessible-svgs-in-high-contrast-mode-hi7h96dcb
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Accessible SVGs in High Contrast Mode | daily.dev
og:description: Explains how to make SVG icons accessible in Windows High Contrast Mode using CSS media queries rather than JavaScript. Covers the -ms-high-contrast media...
og:url: https://daily.dev/posts/accessible-svgs-in-high-contrast-mode-hi7h96dcb
og:image: https://api.daily.dev/og/posts/HI7h96dcb.png
og:image:alt: Accessible SVGs in High Contrast Mode
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Accessible SVGs in High Contrast Mode

**[Eric Bailey](https://daily.dev/sources/ericwbailey)** · 10 min read · 0 upvotes · 0 comments

## Summary

Explains how to make SVG icons accessible in Windows High Contrast Mode using CSS media queries rather than JavaScript. Covers the -ms-high-contrast media feature, its three states (active, white-on-black, black-on-white), CSS2 System Color keywords used for mapping, and practical techniques like fill:ButtonText and CSS filters for tweaking icon appearance. Also discusses why this matters for low-vision users, Windows' large market share, and the upcoming Light Level Media Feature as a future cross-browser alternative.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://css-tricks.com/accessible-svgs-high-contrast-mode>

## Questions this post answers

### How do I target Windows High Contrast Mode with a CSS media query?

Use the vendor-prefixed -ms-high-contrast media feature. `@media screen and (-ms-high-contrast: active)` targets any High Contrast theme, while `white-on-black` and `black-on-white` target specific themes. It only works in Internet Explorer 10+ and Microsoft Edge, and declaring `active` last overrides the other two values due to cascading.

_Developers hardening icon accessibility can keep tabs on browser support quirks like this via daily.dev._

### Why doesn't my SVG icon look right in Windows High Contrast Mode even though the rest of my page adapts fine?

Images, including SVGs, don't automatically translate into high contrast because color and fill values aren't remapped like text and backgrounds are. A button icon can end up with a contrast ratio as low as 2.2, failing WCAG 2.0 contrast requirements, since only text, links, selected text, and backgrounds get mapped automatically to system color keywords like windowText and window.

_When SVG accessibility issues crop up mid-project, daily.dev helps developers find fixes fast._

### How do I make a single-color SVG icon respond correctly to Windows High Contrast Mode?

Hook the icon's fill property to the -ms-high-contrast media query and set it to the ButtonText system color keyword, for example `.button-icon { fill: ButtonText; }` inside `@media screen and (-ms-high-contrast: active)`. This works well for simple, single-color icons; multicolor icons need case-by-case handling to avoid becoming unrecognizable blobs.

_Teams building accessible icon systems can track practical CSS techniques like this on daily.dev._

## Similar posts on daily.dev

- [What’s \!important \#8: Light/Dark Favicons, @mixin, object-view-box, and More](https://daily.dev/posts/what-s-important-8-light-dark-favicons-mixin-object-view-box-and-more-eamcdtly1) · CSS-Tricks · 10 upvotes · 0 comments
- [Automated Accessible Text with contrast-color\(\)](https://daily.dev/posts/automated-accessible-text-with-contrast-color--h4umpqxow) · Una Kravets · 1 upvotes · 0 comments
- [Algorithmic Theming Engines: Building Self-Correcting Color Systems With contrast-color\(\) — Smashing Magazine](https://daily.dev/posts/algorithmic-theming-engines-building-self-correcting-color-systems-with-contrast-color-smashing-afte9iv44) · Smashing Magazine · 4 upvotes · 0 comments
- [Chris’ Corner: A11Y](https://daily.dev/posts/chris-corner-a11y-uqdhzm4a9) · CodePen · 0 upvotes · 0 comments

---

Tags: [#css](https://daily.dev/tags/css), [#accessibility](https://daily.dev/tags/accessibility), [#svg](https://daily.dev/tags/svg)

[View this post on daily.dev](https://daily.dev/posts/accessible-svgs-in-high-contrast-mode-hi7h96dcb)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Accessible SVGs in High Contrast Mode","url":"https://daily.dev/posts/accessible-svgs-in-high-contrast-mode-hi7h96dcb","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/accessible-svgs-in-high-contrast-mode-hi7h96dcb"},"datePublished":"2026-09-20T07:43:53.127Z","dateModified":"2026-09-20T07:46:15.150Z","description":"Explains how to make SVG icons accessible in Windows High Contrast Mode using CSS media queries rather than JavaScript. Covers the -ms-high-contrast media...","image":"https://media.daily.dev/image/upload/s--ZrL_HSsR--/f_auto/v1722860399/public/Placeholder%2006","thumbnailUrl":"https://media.daily.dev/image/upload/s--ZrL_HSsR--/f_auto/v1722860399/public/Placeholder%2006","isAccessibleForFree":true,"articleSection":"Eric Bailey","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Eric Bailey","logo":"https://media.daily.dev/image/upload/s--r1vwe6z1--/f_auto,q_auto/v1789890198/logos/ericwbailey?_a=BAMAMicg0","url":"https://daily.dev/sources/ericwbailey"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/accessible-svgs-in-high-contrast-mode-hi7h96dcb","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"css,accessibility,svg","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Eric Bailey","item":"https://daily.dev/sources/ericwbailey"},{"@type":"ListItem","position":3,"name":"Accessible SVGs in High Contrast Mode"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/accessible-svgs-in-high-contrast-mode-hi7h96dcb#faq","mainEntity":[{"@type":"Question","name":"How do I target Windows High Contrast Mode with a CSS media query?","acceptedAnswer":{"@type":"Answer","text":"Use the vendor-prefixed -ms-high-contrast media feature. `@media screen and (-ms-high-contrast: active)` targets any High Contrast theme, while `white-on-black` and `black-on-white` target specific themes. It only works in Internet Explorer 10+ and Microsoft Edge, and declaring `active` last overrides the other two values due to cascading. Developers hardening icon accessibility can keep tabs on browser support quirks like this via daily.dev."}},{"@type":"Question","name":"Why doesn't my SVG icon look right in Windows High Contrast Mode even though the rest of my page adapts fine?","acceptedAnswer":{"@type":"Answer","text":"Images, including SVGs, don't automatically translate into high contrast because color and fill values aren't remapped like text and backgrounds are. A button icon can end up with a contrast ratio as low as 2.2, failing WCAG 2.0 contrast requirements, since only text, links, selected text, and backgrounds get mapped automatically to system color keywords like windowText and window. When SVG accessibility issues crop up mid-project, daily.dev helps developers find fixes fast."}},{"@type":"Question","name":"How do I make a single-color SVG icon respond correctly to Windows High Contrast Mode?","acceptedAnswer":{"@type":"Answer","text":"Hook the icon's fill property to the -ms-high-contrast media query and set it to the ButtonText system color keyword, for example `.button-icon { fill: ButtonText; }` inside `@media screen and (-ms-high-contrast: active)`. This works well for simple, single-color icons; multicolor icons need case-by-case handling to avoid becoming unrecognizable blobs. Teams building accessible icon systems can track practical CSS techniques like this on daily.dev."}}]}
```

