mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-21 18:54:30 +01: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:
parent
6933bd4a1d
commit
cd7e5d1111
@ -583,3 +583,14 @@ main {
|
|||||||
[hidden] {
|
[hidden] {
|
||||||
display: none !important;
|
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"),
|
(")","%29"),
|
||||||
) !default;
|
) !default;
|
||||||
|
|
||||||
|
// Selectors which are isolated in the transition mixin to prevent invalid selector stack
|
||||||
|
$pseudo-vendor-prefixes: (
|
||||||
|
"::-webkit-",
|
||||||
|
"::-moz-",
|
||||||
|
"::-ms-"
|
||||||
|
) !default;
|
||||||
|
|
||||||
|
|
||||||
// Options
|
// Options
|
||||||
//
|
//
|
||||||
// Quickly modify global styling by enabling or disabling optional features.
|
// Quickly modify global styling by enabling or disabling optional features.
|
||||||
|
@ -9,8 +9,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@if $enable-prefers-reduced-motion-media-query {
|
@if $enable-prefers-reduced-motion-media-query {
|
||||||
@media (prefers-reduced-motion: reduce) {
|
$isolate: false;
|
||||||
transition: none;
|
@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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,3 +51,12 @@
|
|||||||
@import "syntax";
|
@import "syntax";
|
||||||
@import "anchor";
|
@import "anchor";
|
||||||
@import "algolia";
|
@import "algolia";
|
||||||
|
|
||||||
|
@if $enable-prefers-reduced-motion-media-query {
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
%no-transition {
|
||||||
|
// stylelint-disable-next-line property-blacklist, declaration-no-important
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -41,6 +41,7 @@ Changes to our source Sass files and compiled CSS.
|
|||||||
- Line heights are dropped from several components to simplify our codebase. The `button-size()` and `pagination-size()` do not accept line height parameters anymore. [See #29271](https://github.com/twbs/bootstrap/pull/29271)
|
- Line heights are dropped from several components to simplify our codebase. The `button-size()` and `pagination-size()` do not accept line height parameters anymore. [See #29271](https://github.com/twbs/bootstrap/pull/29271)
|
||||||
- The `button-variant()` mixin now accepts 3 optional color parameters, for each button state, to override the color provided by `color-yiq()`. By default, these parameters will find which color provides more contrast against the button state's background color with `color-yiq()`.
|
- The `button-variant()` mixin now accepts 3 optional color parameters, for each button state, to override the color provided by `color-yiq()`. By default, these parameters will find which color provides more contrast against the button state's background color with `color-yiq()`.
|
||||||
- The `button-outline-variant()` mixin now accepts an additional argument, `$active-color`, for setting the button's active state text color. By default, this parameter will find which color provides more contrast against the button's active background color with `color-yiq()`.
|
- The `button-outline-variant()` mixin now accepts an additional argument, `$active-color`, for setting the button's active state text color. By default, this parameter will find which color provides more contrast against the button's active background color with `color-yiq()`.
|
||||||
|
- The `transition()` mixin now extends `%no-transition` placeholder to handle `prefers-reduced-motion` media query-except vendor prefixes listed in new `$pseudo-vendor-prefixes` variable. [See #29870](https://github.com/twbs/bootstrap/pull/29870/)
|
||||||
|
|
||||||
## JavaScript
|
## JavaScript
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user