Created
November 7, 2021 00:15
-
-
Save LeoSeyers/4715f7ec2bdcb8ba6e54472a66b0e472 to your computer and use it in GitHub Desktop.
SCSS Responsive Mixins
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
$bps: ( | |
"phone-sm": 20em /* 320px; dinosaurs */, | |
"phone-md": 23.4em /* 374; Iphone 6 -> X */, | |
"phone-lg": 25.625em /* 410px; Pixel2 */, | |
"tab": 37.5em /* 600x; Ipad */, | |
"tab-lg": 56.25em /* 900px; Ipad Pro:1024px */, | |
"desktop": 75em /* 1200px */, | |
"desktop-md": 85.375em /* 1366px; 1366×768 (8.44%) */, | |
"desktop-lg": 112.5em /* 1800px; 1920×1080 (8.89%) */, | |
"desktop-xlg": 137.5em /* 2200px, 4K 24"+ */, | |
); | |
@mixin respond($breakpoint) { | |
$bp: map-get($bps, $breakpoint); | |
@media only screen and (min-width: $bp) { | |
@content; | |
} | |
} | |
@mixin max-width($breakpoint) { | |
$bp: map-get($bps, $breakpoint); | |
@media only screen and (max-width: $bp) { | |
@content; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment