Created
May 21, 2019 10:37
-
-
Save dieppon/063fdf5420db587acc29d6552c691afd to your computer and use it in GitHub Desktop.
Target browsers with css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @mixin only-browser($browser) { | |
| // Firefox | |
| @if $browser == 'mozilla' or $browser == 'firefox' { | |
| @-moz-document url-prefix() { @content; } | |
| } | |
| // IE | |
| @if $browser == 'ie' { | |
| @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { @content; } | |
| } | |
| // Edge | |
| @if $browser == 'edge' { | |
| @supports (-ms-ime-align: auto) { @content; } | |
| } | |
| // Safari 9+ | |
| @if $browser == 'safari' { | |
| @supports (-webkit-marquee-repetition:infinite) and (object-fit:fill) { @content; } | |
| } | |
| // Google Chrome | |
| @if $browser == 'chrome' { | |
| @supports (-webkit-appearance:none) and (not (overflow:-webkit-marquee)) and (not (-ms-ime-align:auto)) and (not (-moz-appearance:none)) { @content; } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment