Last active
September 7, 2020 13:41
-
-
Save joellesenne/a645ab17f8de3cb28723b2b1a5db9abf to your computer and use it in GitHub Desktop.
Media Queries in SCSS
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 Queries in SCSS <https://css-tricks.com/approaches-media-queries-sass/#landon-schropps-technique> | |
// Variables | |
$tablet-width: 768px; | |
$desktop-width: 1024px; | |
@mixin tablet { | |
@media (min-width: #{$tablet-width}) and (max-width: #{$desktop-width - 1px}) { | |
@content; | |
} | |
} | |
// Mixins | |
@mixin desktop { | |
@media (min-width: #{$desktop-width}) { | |
@content; | |
} | |
} | |
// How to use | |
// @include tablet { | |
// @content here | |
// } | |
// Output | |
// @media (min-width: 768px) and (max-width: 950px) { | |
// @content here | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment