Skip to content

Instantly share code, notes, and snippets.

@ijmccallum
Created August 6, 2015 15:40
Show Gist options
  • Save ijmccallum/16e3d01436fac7d038a7 to your computer and use it in GitHub Desktop.
Save ijmccallum/16e3d01436fac7d038a7 to your computer and use it in GitHub Desktop.
Sass mixin for applying breakpoints throughout our styles
/* 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