Skip to content

Commit

Permalink
rustdoc: do not animate :target when user prefers reduced motion
Browse files Browse the repository at this point in the history
This accessibility improvement gates #129284 behind an inverted
prefers-reduced-motion media query.
  • Loading branch information
zopsicle authored and zopsicle committed Sep 25, 2024
1 parent 0399709 commit 9a0c685
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,12 @@ instead, we check that it's not a "finger" cursor.
padding-right: 3px;
background-color: var(--target-background-color);
border-right: 3px solid var(--target-border-color);
animation: 0.65s cubic-bezier(0, 0, 0.1, 1.0) 0.1s targetfadein;
}

@media not (prefers-reduced-motion) {
:target {
animation: 0.65s cubic-bezier(0, 0, 0.1, 1.0) 0.1s targetfadein;
}
}

.code-header a.tooltip {
Expand Down

0 comments on commit 9a0c685

Please sign in to comment.