Created
August 6, 2015 15:40
-
-
Save ijmccallum/16e3d01436fac7d038a7 to your computer and use it in GitHub Desktop.
Sass mixin for applying breakpoints throughout our styles
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
/* BREAK POINTS | |
* =============================================================== | |
* Thanks to ... | |
* This can be added outside a selector, or within! | |
* | |
* eg: | |
* @include breakpoint(medium) { | |
* //all the stuff for medium and up in here | |
* } | |
* and for old ie stylesheet: | |
* if ($oldIE) { | |
* //old ie stuff here | |
* } | |
*/ | |
$oldIE: false !default; | |
$breakpoints: ( | |
small: 360px, | |
medium: 768px, | |
wide: 980px, | |
superwide: 1200px | |
); | |
@mixin breakpoint($point) { | |
@if $oldIE { | |
@content; | |
}@else{ | |
@each $breakpoint in $breakpoints { | |
@if $point == nth($breakpoint, 1) { | |
@media (min-width: nth($breakpoint, 2)) { | |
@content; | |
} | |
} | |
} | |
} | |
} | |
//in oldie.scss - then add ie8 shim to load the old ie stylesheet | |
$oldIE:true; | |
@import main.scss; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment