Created
May 29, 2025 00:04
-
-
Save jenlampton/c3a1bf7a8b19953fa6bb9079c0ac2b64 to your computer and use it in GitHub Desktop.
Hard-code screen widths in one file, but then define variables that can be used across all breakpoints?
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
@media (min-width: 25em) { /* 400px @ 16px font size -- XS */ | |
:root { | |
--screen: 25em; | |
--max-area: 20em; | |
} | |
} | |
@media (min-width: 34em) { /* 544px @ 16px font size -- SM */ | |
:root { | |
--screen: 34em; | |
--max-area: 30em; | |
} | |
} | |
@media (min-width: 48em) { /* 768px @ 16px font size -- MD */ | |
:root { | |
--screen: 48em; | |
--max-area: 42em; | |
} | |
} | |
@media (min-width: 62em) { /* 992px @ 16px font size -- LG */ | |
:root { | |
--screen: 62em; | |
--max-area: 60em; | |
} | |
} | |
@media (min-width: 75em) { /* 1200px @ 16px font size -- XL */ | |
:root { | |
--screen: 75em; | |
--max-area: 70em; | |
} | |
} | |
@media (min-width: 90em) { /* 1440px @ 16px font size -- XXL */ | |
:root { | |
--screen: 90em; | |
--max-area: 80em; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment