File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/* *
2- * Reduced-motion for animations
2+ * Motion preference helpers for animations
33 *
44 * Driven by `html.js-animation` / `html.no-js-animation` (toggled from
55 * prefers-reduced-motion in header.php, and by the a11y access config plugin).
66 *
77 * @author Paolo Tesei
88 *
9- * @param $reduce
10- *
119 * Examples :
1210 *
1311 * @include reduced-motion { ... }
1412 * → html.no-js-animation & { ... }
1513 *
16- * you can add heavy animation using :
17- *
18- * @include reduced-motion (false) { ... }
14+ * @include allows-motion { ... }
1915 * → html.js-animation & { ... }
2016 *
2117 */
2218
23- @mixin reduced-motion ($reduce : true) {
24- $class : if ($reduce , " no-js-animation" , " js-animation" );
25-
19+ @mixin _html-animation-class ($class ) {
2620 @if not & {
2721 html .#{$class } {
2822 @content ;
3327 }
3428 }
3529}
30+
31+ // Styles when motion is reduced (`html.no-js-animation`).
32+ @mixin reduced-motion {
33+ @include _html-animation-class (" no-js-animation" ) {
34+ @content ;
35+ }
36+ }
37+
38+ // Styles when animations are allowed (`html.js-animation`).
39+ @mixin allows-motion {
40+ @include _html-animation-class (" js-animation" ) {
41+ @content ;
42+ }
43+ }
Original file line number Diff line number Diff line change 4343 --paragraph--line-height-small : 1.4 ;
4444 --paragraph--line-height-default : 1.4 ;
4545
46- /*
47- * Animation speeds
48- */
49- --speed : 1s ;
50-
5146 /*
5247 * Admin bar
5348 */
5449 --wp-admin-bar-height : var (--wp-admin--admin-bar--height , 0rem );
5550
56- /*
57- * A11y reduced motion
58- */
59- @include reduced-motion {
60- --speed : 0s ;
61- }
62-
6351 /*
6452 * Global breakpoints
6553 */
You can’t perform that action at this time.
0 commit comments