diff options
| author | Gaël Poupard <[email protected]> | 2020-02-14 20:50:50 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-02-14 20:50:50 +0100 |
| commit | cd7e5d111102e4422858aa6f255dc243b4cca1ca (patch) | |
| tree | 46630f3e8b05fbe93e7e0147b98f365d646e9058 /scss | |
| parent | 6933bd4a1d9b3b1de109fc43d9a0da858c205fb0 (diff) | |
| download | bootstrap-cd7e5d111102e4422858aa6f255dc243b4cca1ca.tar.xz bootstrap-cd7e5d111102e4422858aa6f255dc243b4cca1ca.zip | |
Placeholder for transitions reset to prevent code duplication… (#29870)
Co-authored-by: Martijn Cuppens <[email protected]>
Co-authored-by: XhmikosR <[email protected]>
Diffstat (limited to 'scss')
| -rw-r--r-- | scss/_reboot.scss | 11 | ||||
| -rw-r--r-- | scss/_variables.scss | 8 | ||||
| -rw-r--r-- | scss/mixins/_transition.scss | 15 |
3 files changed, 32 insertions, 2 deletions
diff --git a/scss/_reboot.scss b/scss/_reboot.scss index e6be84e40..e05b541fd 100644 --- a/scss/_reboot.scss +++ b/scss/_reboot.scss @@ -583,3 +583,14 @@ main { [hidden] { display: none !important; } + +// Placeholder used to reset transitions, when user prefers reduced motion + +@if $enable-prefers-reduced-motion-media-query { + @media (prefers-reduced-motion: reduce) { + %no-transition { + // stylelint-disable-next-line property-blacklist + transition: none !important; + } + } +} diff --git a/scss/_variables.scss b/scss/_variables.scss index c32c634de..5c24269e2 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -212,6 +212,14 @@ $escaped-characters: ( (")","%29"), ) !default; +// Selectors which are isolated in the transition mixin to prevent invalid selector stack +$pseudo-vendor-prefixes: ( + "::-webkit-", + "::-moz-", + "::-ms-" +) !default; + + // Options // // Quickly modify global styling by enabling or disabling optional features. diff --git a/scss/mixins/_transition.scss b/scss/mixins/_transition.scss index 8ce35a6b8..43843e3f2 100644 --- a/scss/mixins/_transition.scss +++ b/scss/mixins/_transition.scss @@ -9,8 +9,19 @@ } @if $enable-prefers-reduced-motion-media-query { - @media (prefers-reduced-motion: reduce) { - transition: none; + $isolate: false; + @each $selector in $pseudo-vendor-prefixes { + @if str-index(quote(#{&}), $selector) { + $isolate: true; + } + } + + @if $isolate { + @media (prefers-reduced-motion: reduce) { + transition: none; + } + } @else { + @extend %no-transition; } } } |
