UNPKG

@gitlab/ui

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