Created
September 6, 2018 11:21
-
-
Save FellowshipAgency/ab680f60343e0c800e4f8204aad94d56 to your computer and use it in GitHub Desktop.
Easily disable CSS Grid
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
// To easily view how a site looks when CSS Grid is not available, use this in the SASS file. | |
// First you need this variable: | |
$cssgrid: "(grid-template-rows:initial)"; | |
// Then you can uncomment the below to re-declare the variable and so disable the @supports for every browser: | |
// $cssgrid: "(display:no-css-grid-support)"; | |
// Wrap every usage of CSS Grid in this: | |
@supports(#{$cssgrid}) { | |
display: grid; | |
grid-template-rows: 1fr 1fr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can also use this to check if something doesn't support CSS grid:
@supports (not #{$cssgrid}) {
// Fallback code here
}