UNPKG

@gitlab/ui

Version:
24 lines (19 loc) 469 B
export const breakpoints = { xl: 1200, lg: 992, md: 768, sm: 576, xs: 0, }; const BreakpointInstance = { windowWidth: () => window.innerWidth, getBreakpointSize() { const windowWidth = this.windowWidth(); const breakpoint = Object.keys(breakpoints).find((key) => windowWidth > breakpoints[key]); return breakpoint; }, isDesktop() { return ['xl', 'lg'].includes(this.getBreakpointSize()); }, }; export default BreakpointInstance;