mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-29 08:10:47 +02:00
Placeholder for transitions reset to prevent code duplication… (#29870)
Co-authored-by: Martijn Cuppens <martijn.cuppens@gmail.com> Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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.
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user