Skip to content

Instantly share code, notes, and snippets.

@maxxcrawford
Created August 31, 2020 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxxcrawford/988f98bb3bb2bdd198297c69ce1d2b9a to your computer and use it in GitHub Desktop.
Save maxxcrawford/988f98bb3bb2bdd198297c69ce1d2b9a to your computer and use it in GitHub Desktop.
SASS Mix-in Example for Media Query
@mixin mq-at-least($device-width) {
@media screen and (min-width: $device-width){
@content;
}
}
.container {
width: 100%;
@include mq-at-least(768px){
max-width: 50%;
}
}
/* generated css: */
.container {
width: 100%;
}
@media screen and (min-width: 768px) {
.container {
max-width: 50%;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment