2022-06-21 14:57:05 +03:00

20 lines
485 B
TypeScript

const screens = {
tablet: 768,
laptop: 1024,
desktop: 1680,
'desktop-xl': 1921,
};
const threshold = 0;
export function min(breakpoint: keyof typeof screens) {
return `@media (min-width: calc(${screens[breakpoint]}px + ${threshold}px))`;
}
export function max(breakpoint: keyof typeof screens) {
return `@media (max-width: calc(${screens[breakpoint]}px))`;
}
export const mediaQuery = {
breakpoints: Object.values(screens).map((value) => `${value + threshold}px`),
};