fix(appearance): give reduced-motion transitions no duration so layout reads stay right (#5961)

Reduce motion set every element's transition-duration to 0.01ms. With the default transition-property: all, every property change on every element became a transition, CodeMirror's virtual height gaps included, so a layout read right after a change saw the old size and diff navigation scrolled to the end of the file instead of centring the change. Transitions now get 0s; animations keep 0.01ms so their end events still fire.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-26 04:06:58 +08:00
1 джерело 5a884d7cba
коміт eb078a0a19
1 file changed
+5 -3
+5 -3
Переглянути файл
@@ -22,14 +22,16 @@
/* Appearance › Reduce motion, or the system's reduced-motion preference: animations jump to their
end state and transitions apply at once, so spinners stand still and popups appear without a
fade. Animation events still fire. */
fade. Animation events still fire. Transitions get no duration at all: with the default
`transition-property: all`, any non-zero one would make every element, CodeMirror's height
gaps included, report its old size for a frame after a change and throw off layout reads. */
:root[data-reduce-motion] *,
:root[data-reduce-motion] *::before,
:root[data-reduce-motion] *::after {
animation-duration: 0.01ms !important;
animation-delay: 0s !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
transition-duration: 0s !important;
transition-delay: 0s !important;
scroll-behavior: auto !important;
}
@@ -41,7 +43,7 @@
animation-duration: 0.01ms !important;
animation-delay: 0s !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
transition-duration: 0s !important;
transition-delay: 0s !important;
scroll-behavior: auto !important;
}