diff options
| author | Chris Rebert <[email protected]> | 2016-11-25 14:51:55 -0800 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2016-11-25 14:51:55 -0800 |
| commit | 3593ee85c1c8aed948bbe636194fcd5f0988878e (patch) | |
| tree | 57d75ea0a5db8d902cda0d27a7136d27a76b2c98 /scss | |
| parent | 3cfd40782cfb9a158bb7b0f0bed415f4e296f6ca (diff) | |
| download | bootstrap-3593ee85c1c8aed948bbe636194fcd5f0988878e.tar.xz bootstrap-3593ee85c1c8aed948bbe636194fcd5f0988878e.zip | |
Add @supports feature query for Carousel CSS 3D transforms; fixes #15534 (#19751)
[skip sauce]
[skip validator]
Diffstat (limited to 'scss')
| -rw-r--r-- | scss/_carousel.scss | 4 | ||||
| -rw-r--r-- | scss/_mixins.scss | 1 | ||||
| -rw-r--r-- | scss/mixins/_transforms.scss | 14 |
3 files changed, 17 insertions, 2 deletions
diff --git a/scss/_carousel.scss b/scss/_carousel.scss index 9386983d1..625ab1c8d 100644 --- a/scss/_carousel.scss +++ b/scss/_carousel.scss @@ -20,8 +20,8 @@ line-height: 1; } - // WebKit CSS3 transforms for supported devices - @media all and (transform-3d), (-webkit-transform-3d) { + // CSS3 transforms when supported by the browser + @include if-supports-3d-transforms() { transition: transform .6s ease-in-out; backface-visibility: hidden; perspective: 1000px; diff --git a/scss/_mixins.scss b/scss/_mixins.scss index 375e8486d..6d613b9a3 100644 --- a/scss/_mixins.scss +++ b/scss/_mixins.scss @@ -28,6 +28,7 @@ @import "mixins/text-emphasis"; @import "mixins/text-hide"; @import "mixins/text-truncate"; +@import "mixins/transforms"; @import "mixins/visibility"; // // Components diff --git a/scss/mixins/_transforms.scss b/scss/mixins/_transforms.scss new file mode 100644 index 000000000..4005c9d02 --- /dev/null +++ b/scss/mixins/_transforms.scss @@ -0,0 +1,14 @@ +// Applies the given styles only when the browser support CSS3 3D transforms. +@mixin if-supports-3d-transforms() { + @media (-webkit-transform-3d) { + // Old Safari, Old Android + // http://caniuse.com/#feat=css-featurequeries + // https://developer.mozilla.org/en-US/docs/Web/CSS/@media/-webkit-transform-3d + @content; + } + + @supports (transform: translate3d(0,0,0)) { + // The Proper Way: Using a CSS feature query + @content; + } +} |
