Created
August 31, 2020 20:43
-
-
Save maxxcrawford/988f98bb3bb2bdd198297c69ce1d2b9a to your computer and use it in GitHub Desktop.
SASS Mix-in Example for Media Query
This file contains hidden or 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
@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