Last active
December 13, 2015 16:48
-
-
Save Darep/4943094 to your computer and use it in GitHub Desktop.
_breakpoints.scss from a small project with support for old IE. This requires that when declaring the media-queries, you declare them from smallest to widest. Note: mixin can only be used inside a CSS declaration block.
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
// Breakpoints for responsive design ($cols are from Frameless Grid) | |
$breakpoint-1: $cols5; | |
$breakpoint-2: $cols7; | |
$breakpoint-3: $cols9; | |
@mixin breakpoint($point) { | |
@if $point == wide { | |
@media (min-width: $breakpoint-3) { @content; } | |
.oldie & { @content; } | |
} | |
@else if $point == medium { | |
@media (min-width: $breakpoint-2) { @content; } | |
.oldie & { @content; } | |
} | |
@else if $point == narrow { | |
@media (min-width: $breakpoint-1) { @content; } | |
.oldie & { @content; } | |
} | |
@else { | |
@media (#{$point}) { @content; } | |
} | |
} | |
// Usage: @include breakpoint(wide) { width: 45em; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment