Created
February 10, 2017 06:02
-
-
Save toddzebert/5098c8bb3d401a15a0712b5a3f2fd1c6 to your computer and use it in GitHub Desktop.
Sharing CSS breakpoints with JavaScript - SCSS
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
@import "breakpoint"; | |
// loop through the map and add the breakpoints | |
@mixin add-bp($bps) { | |
@each $bp-name, $bp in $bps { | |
@include add-breakpoint($bp-name, $bp); | |
} | |
} | |
// loop through the map and set `content` | |
@mixin bp-export($bps : $site-breakpoints) { | |
display: none; // Prevent from displaying, including in chrome inspect! | |
@each $bp-name, $setting in $bps { | |
@include respond-to($bp-name) { | |
content: $bp-name; | |
} | |
} | |
} | |
// not required, but shows how conversion to ems makes breakpoint sizes "indefinite" | |
@include breakpoint-set('to ems', true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment