Skip to content

Commit 7d8165c

Browse files
committed
Improved support for reduced motion media
1 parent 37bd327 commit 7d8165c

File tree

9 files changed

+17
-39
lines changed

9 files changed

+17
-39
lines changed

material/assets/stylesheets/main.bb3983ee.min.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/assets/stylesheets/main.bb3983ee.min.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/assets/stylesheets/main.c45fdb8e.min.css

Lines changed: 0 additions & 9 deletions
This file was deleted.

material/assets/stylesheets/main.c45fdb8e.min.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

material/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
{% endif %}
3535
{% endblock %}
3636
{% block styles %}
37-
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.c45fdb8e.min.css' | url }}">
37+
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.bb3983ee.min.css' | url }}">
3838
{% if config.theme.palette %}
3939
{% set palette = config.theme.palette %}
4040
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.e6a45f82.min.css' | url }}">

src/assets/stylesheets/main/_resets.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ html {
3636
*::before,
3737
*::after {
3838
box-sizing: inherit;
39+
40+
// [reduced motion]: Disable all transitions
41+
@media (prefers-reduced-motion) {
42+
transition: none !important; // stylelint-disable-line
43+
}
3944
}
4045

4146
// Remove margin in all browsers

src/assets/stylesheets/main/extensions/pymdownx/_arithmatex.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
// Arithmatex content
4040
> * {
4141
width: min-content;
42-
// stylelint-disable-next-line declaration-no-important
43-
margin: 1em auto !important;
42+
margin: 1em auto !important; // stylelint-disable-line
4443
padding: 0 px2rem(16px);
4544
touch-action: auto;
4645
}

src/assets/stylesheets/main/extensions/pymdownx/_tabbed.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,6 @@
109109
transform 250ms;
110110
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
111111
content: "";
112-
113-
// [reduced motion]: Disable animation
114-
@media (prefers-reduced-motion) {
115-
transition: none;
116-
}
117112
}
118113
}
119114
}

src/assets/stylesheets/main/layout/_tooltip.scss

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@
8585
max-height 0ms 250ms,
8686
z-index 250ms;
8787

88-
// [reduced motion]: Disable animation
89-
@media (prefers-reduced-motion) {
90-
transition: none;
91-
}
92-
9388
// Tooltip on parent focus
9489
:focus-within > & {
9590
max-height: 1000%;
@@ -100,11 +95,6 @@
10095
opacity 250ms,
10196
max-height 250ms,
10297
z-index 0ms;
103-
104-
// [reduced motion]: Disable animation
105-
@media (prefers-reduced-motion) {
106-
transition: none;
107-
}
10898
}
10999

110100
// Show outline for keyboard devices
@@ -196,7 +186,6 @@
196186

197187
// [reduced motion]: Disable animation
198188
@media (prefers-reduced-motion) {
199-
transition: none;
200189
animation: none;
201190
}
202191

@@ -211,11 +200,6 @@
211200
color 250ms,
212201
background-color 250ms;
213202
animation: none;
214-
215-
// [reduced motion]: Disable animation
216-
@media (prefers-reduced-motion) {
217-
transition: none;
218-
}
219203
}
220204
}
221205

@@ -225,11 +209,6 @@
225209
transition: transform 400ms cubic-bezier(0.1, 0.7, 0.1, 1);
226210
content: attr(data-md-annotation-id);
227211

228-
// [reduced motion]: Disable animation
229-
@media (prefers-reduced-motion) {
230-
transition: none;
231-
}
232-
233212
// [not print]: if we're not in print mode, show a `+` sign instead of
234213
// the original numbers, as context is already given by the position.
235214
@media not print {

0 commit comments

Comments
 (0)