Skip to content

Instantly share code, notes, and snippets.

@pigeonfresh
Created November 28, 2019 18:05
Show Gist options
  • Save pigeonfresh/62388c517049715ab7a9b050a9ba90bd to your computer and use it in GitHub Desktop.
Save pigeonfresh/62388c517049715ab7a9b050a9ba90bd to your computer and use it in GitHub Desktop.
MQ
$mediaQueryHacks: (maxWidth767, '(max-width: 767px)');
@mixin respond-to($name, $list: $mediaQueries) {
@if map-has-key($mediaQueries, $name) {
@media #{map-get($mediaQueries, $name)} {
@content;
}
} @else {
@error "MediaQuery #{$name} does not exist";
}
}
@include respond-to(maxWidth767, $mediaQueryHacks) {
background: red;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment