Created
November 17, 2015 17:45
-
-
Save sdempsey/6ee80902a75f9f32a63f to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// ---- | |
// Sass (v3.4.14) | |
// Compass (v1.0.3) | |
// ---- | |
$base-font-size: 16px; | |
@function em($px, $base: $base-font-size) { | |
@return ($px / $base) + 0em; | |
} | |
$breakpoints: ( | |
600: em(600px), | |
760: em(760px), | |
1000: em(1000px), | |
1200: em(1200px) | |
); | |
@mixin bp($breakpoint, $min-or-max: min-width) { | |
@if map-has-key($breakpoints, $breakpoint) { | |
@media screen and ($min-or-max: #{map-get($breakpoints, $breakpoint)}) { | |
@content; | |
} | |
} @else { | |
@warn "No variable '#{$breakpoint}' in $breakpoints map"; | |
} | |
} | |
.selector { | |
@include bp(600) { | |
color: red; | |
} | |
@include bp(1200, max-width) { | |
color: blue; | |
} | |
} |
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
@media screen and (min-width: 37.5em) { | |
.selector { | |
color: red; | |
} | |
} | |
@media screen and (max-width: 75em) { | |
.selector { | |
color: blue; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment