дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-05 01:31:41 +02:00
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.
Цей коміт міститься в:
1 джерело
5a884d7cba
коміт
eb078a0a19
1 file changed
+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;
|
||||
}
|
||||
|
||||
Reference in new issue
Заблокувати користувача