-
-
Save ethanmuller/1ef5d97dd9f851ec22b4 to your computer and use it in GitHub Desktop.
Examples for sb-media Foundry post
This file contains 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
@import "mixins"; // contains sb-media mixin | |
@import "box"; |
This file contains 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
.box { | |
background-color: blue; | |
@include sb-media(45em) { | |
background-color: purple; | |
} | |
} |
This file contains 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
$no-mq-support: false !default; | |
$serve-to-nomq-max-width: 60em; | |
@mixin sb-media($query) { | |
@if $no-mq-support{ | |
@if $query < $serve-to-nomq-max-width { | |
@content; | |
} | |
} @else { | |
@media ( 'min-width:' + $query ) { | |
@content; | |
} | |
} | |
} |
This file contains 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
/* I'm rendered CSS */ | |
.box { | |
background-color: blue; | |
@media (min-width: 45em) { | |
background-color: purple; | |
} | |
} |
This file contains 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
@import "base"; |
This file contains 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
/* I'm rendered CSS */ | |
.box { | |
background-color: blue; | |
background-color: purple; | |
} |
This file contains 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
$no-mq-support: true; | |
@import "base"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment