Media queries

Media queries

NameApplies from width
mediumMobile414px
largeMobile576px
tablet768px
desktop992px
largeDesktop1200px

Constants

export enum QUERIES {
MEDIUMMOBILE = "mediumMobile",
LARGEMOBILE = "largeMobile",
TABLET = "tablet",
DESKTOP = "desktop",
LARGEDESKTOP = "largeDesktop",
}
export const TOKEN = {
mediumMobile: "widthBreakpointMediumMobile",
largeMobile: "widthBreakpointLargeMobile",
tablet: "widthBreakpointTablet",
desktop: "widthBreakpointDesktop",
largeDesktop: "widthBreakpointLargeDesktop",
} as const;

getBreakpointWidth function

getBreakpointWidth(breakpoint: keyof typeof TOKEN, theme: Theme, pure?: boolean) => string | number

Arguments

NameTypeDescription
breakpointkeyof typeof TOKENThe name of the breakpoint.
themeThemeThe theme object.
purebooleanOptional. If true, the function will return the value as number. If false, it will return a string "(min-width: ${VAL}px)", where VAL is the value of the breakpoint width.