diff --git a/docs/resources/changelog.md b/docs/resources/changelog.md index 6c9cb343..8ba8c8ca 100644 --- a/docs/resources/changelog.md +++ b/docs/resources/changelog.md @@ -18,6 +18,7 @@ New versions of Shoelace are released as-needed and generally occur when a criti - Fixed a bug in form controls that erroneously prevented validation states from being set when `novalidate` was used on the containing form [#1164](https://github.com/shoelace-style/shoelace/issues/1164) - Improved the behavior of `` in Safari so keyboard interaction works the same as in other browsers [#1177](https://github.com/shoelace-style/shoelace/issues/1177) - Improved the [icons](/components/icon) page so it's not as sluggish in Safari [#1122](https://github.com/shoelace-style/shoelace/issues/1122) +- Improved the accessibility of `` when used in forced-colors / Windows High Contrast mode [#1114](https://github.com/shoelace-style/shoelace/issues/1114) ## 2.0.0 diff --git a/src/components/switch/switch.styles.ts b/src/components/switch/switch.styles.ts index 45b682e4..7af5d33e 100644 --- a/src/components/switch/switch.styles.ts +++ b/src/components/switch/switch.styles.ts @@ -154,4 +154,11 @@ export default css` content: var(--sl-input-required-content); margin-inline-start: var(--sl-input-required-content-offset); } + + @media (forced-colors: active) { + .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb, + .switch--checked .switch__control .switch__thumb { + background-color: ButtonText; + } + } `;