13 lines
412 B
TypeScript
13 lines
412 B
TypeScript
import { screens } from './screens';
|
|
|
|
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 breakpoints = Object.values(screens).map((value) => `${value + threshold}px`);
|