Skip to content

Commit

Permalink
feat(transition): reduce motion globally instead of duplicating singl…
Browse files Browse the repository at this point in the history
…e declaration block, to close #255
  • Loading branch information
ffoodd committed Dec 13, 2019
1 parent aefcc36 commit e6f7814
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
20 changes: 20 additions & 0 deletions scss/_transitions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
&:not(.show) {
display: none;
}

// Boosted mod: try to improve performance
@if $enable-transitions {
will-change: height;
}
// end mod
}

.collapsing {
Expand All @@ -18,3 +24,17 @@
overflow: hidden;
@include transition($transition-collapse);
}

// Boosted mod
// stylelint-disable declaration-no-important
@if $enable-prefers-reduced-motion-media-query {
@media (prefers-reduced-motion: reduce) {
* {
transition-duration: .01ms !important;
animation-duration: .01ms !important;
animation-iteration-count: 1 !important;
}
}
}
// stylelint-enable declaration-no-important
// end mod
6 changes: 0 additions & 6 deletions scss/mixins/_transition.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,4 @@
transition: $transition;
}
}

@if $enable-prefers-reduced-motion-media-query {
@media (prefers-reduced-motion: reduce) {
transition: none;
}
}
}

0 comments on commit e6f7814

Please sign in to comment.