Forced Colours
Many Design Systems have a 'High Contrast' mode, with a more limited set of colours in a significantly higher contrast ratio, often implemented as a simple theme that can be swapped in to replace the standard theme.
Whilst a laudable effort, this cannot be guaranteed to satisfy all users. There are many reasons that end users will require a different set of colours for your UI, and the one you provide will not be able to handle all of those cases.
Happily, all operating systems come with a custom 'high contrast' mode, where users can specify a limited set of colours they wish to see across applications. This is communicated to the browser through the forced-colors media feature, with values provided through the <system-color> data type.
Respecting the users forced colour preferences greatly increases the chances of serving a usable UI.
Layer/Background/PanelLayer/Background/PrimaryLayer/Background/SentimentLayer/Foreground/PanelLayer/Foreground/PrimaryLayer/Foreground/SentimentLayer/Border/PanelLayer/Border/PrimaryLayer/Border/SentimentTransparentSemantics/Disabled/BackgroundSemantics/Disabled/BackgroundSemantics/Disabled/ForegroundSemantics/Disabled/ForegroundSemantics/Disabled/ForegroundSemantics/Disabled/BorderSemantics/Disabled/BorderSemantics/Disabled/BorderSystem/CanvasSystem/ButtonFaceSystem/ButtonFaceSystem/CanvasTextSystem/ButtonTextSystem/ButtonTextSystem/CanvasTextSystem/ButtonBorderSystem/ButtonBorderTransparentTransparentTransparentSystem/GrayTextSystem/GrayTextSystem/GrayTextSystem/GrayTextSystem/GrayTextSystem/GrayTextWe then have a set of variables to switch between standard and forced colours mode:
Container/Standard/Active/BackgroundContainer/Forced Colours/Active/BackgroundContainer/Standard/Active/ForegroundContainer/Forced Colours/Active/ForegroundContainer/Standard/Active/BorderContainer/Forced Colours/Active/BorderContainer/Standard/Disabled/BackgroundContainer/Forced Colours/Disabled/BackgroundContainer/Standard/Disabled/ForegroundContainer/Forced Colours/Disabled/ForegroundContainer/Standard/Disabled/BorderContainer/Forced Colours/Disabled/BorderBefore our final layer that selects between Active/Disabled states:
Container/Active/BackgroundContainer/Disabled/BackgroundContainer/Active/ForegroundContainer/Disabled/ForegroundContainer/Active/BorderContainer/Disabled/Border