Skip to content

Instantly share code, notes, and snippets.

@murger
Created February 14, 2018 10:59
Show Gist options
  • Save murger/7cbc4ff7307521448a29cdfd76a04b9f to your computer and use it in GitHub Desktop.
Save murger/7cbc4ff7307521448a29cdfd76a04b9f to your computer and use it in GitHub Desktop.
@media mixin
$breakpoints: (
tiny: 320px,
x-small: 640px,
small: 768px,
medium: 1024px,
large: 1280px,
x-large: 1440px,
);
@mixin media($rule, $bp) {
@if (map-has-key($breakpoints, $bp)) {
@media (#{$rule}-width: map-get($breakpoints, $bp)) { @content; }
} @else {
@warn 'Breakpoints supported: ' + map-keys($breakpoints);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment