Skip to content

176 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.

fix: keep the focus ring of a Segmented Control option visible in forced-colors mode

matin6d7c61e5d083
diff --git a/animations/04-micro-interactions/segmented-control/index.html b/animations/04-micro-interactions/segmented-control/index.html
index 0deb1827..218ebd6c 100644
--- a/animations/04-micro-interactions/segmented-control/index.html
+++ b/animations/04-micro-interactions/segmented-control/index.html
@@ -31,8 +31,8 @@
.seg-opt{position:relative;z-index:1;appearance:none;background:none;border:0;cursor:pointer;font-family:inherit;font-size:clamp(11px,1.4vw,13px);color:var(--ui-muted);padding:0 clamp(10px,2.4vw,22px);min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;border-radius:9px;transition:color var(--dur) var(--ease);-webkit-tap-highlight-color:transparent}
.seg-opt[aria-checked="true"]{color:#0b0b0d;font-weight:500}
.seg-track.underline .seg-opt[aria-checked="true"]{color:var(--ui-accent)}
- /* The option draws its own focus ring, so it also switches off the site ring (.stage keeps this above body.hb :focus-visible) */
- .stage .seg-opt:focus-visible{outline:none;box-shadow:0 0 0 2px var(--bg),0 0 0 4px var(--ui-accent)}
+ /* The option draws its own focus ring, so it also hides the site ring (.stage keeps this above body.hb :focus-visible). The outline stays, transparent, for forced-colors mode, which removes box-shadow. */
+ .stage .seg-opt:focus-visible{outline:2px solid transparent;box-shadow:0 0 0 2px var(--bg),0 0 0 4px var(--ui-accent)}
@media(hover:hover){.seg-opt:not([aria-checked="true"]):hover{color:var(--ui-text)}}
@media(max-width:600px){.stage{padding-left:10px;padding-right:10px}}
@media(prefers-reduced-motion:reduce){.seg-ind,.seg-opt{transition:none!important}}