Stronger borders when forced
@media (forced-colors: active) {
.card {
border: 2px solid ButtonText;
background: Canvas;
color: CanvasText;
}
}
The forced-colors media feature detects when the user agent overrides author colors with a limited palette (for example Windows High Contrast). Adapt borders and focus styles so content stays clear.
@media (forced-colors: active) {
.card { border: 2px solid ButtonText; }
}@media (forced-colors: active) {
.card {
border: 2px solid ButtonText;
background: Canvas;
color: CanvasText;
}
}forced-colors is a CSS media feature.
Treat as progressive enhancement.
Bottom line: Keep usable default styles outside the query.
Continue with prefers-reduced-data.
CODETOFUN NEWS
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
2 people found this page helpful