Created
June 3, 2021 17:15
-
-
Save kosciolek/49a62178f5be5b3edd4110497084d058 to your computer and use it in GitHub Desktop.
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
export const breakpoints = { | |
xs: "0px", | |
sm: "600px", | |
md: "960px", | |
lg: "1280px", | |
xl: "1920px" | |
}; | |
export const query = Object.entries(breakpoints).reduce( | |
(acc, [breakpoint, value]) => { | |
acc[breakpoint] = `@media screen and (min-width: ${value})`; | |
return acc; | |
}, | |
{} as {[K in keyof typeof breakpoints]: `@media screen and (min-width: ${typeof breakpoints[K]})`} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment