mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
refactor(all): updating to newest stencil apis (#18578)
* chore(): update ionicons * refactor(all): updating to newest stencil apis * fix lint issues * more changes * moreee * fix treeshaking * fix config * fix checkbox * fix stuff * chore(): update ionicons * fix linting errors
This commit is contained in:
@ -10,13 +10,13 @@ export const SIZE_TO_MEDIA: any = {
|
||||
// Check if the window matches the media query
|
||||
// at the breakpoint passed
|
||||
// e.g. matchBreakpoint('sm') => true if screen width exceeds 576px
|
||||
export function matchBreakpoint(win: Window, breakpoint: string | undefined) {
|
||||
export function matchBreakpoint(breakpoint: string | undefined) {
|
||||
if (breakpoint === undefined || breakpoint === '') {
|
||||
return true;
|
||||
}
|
||||
if ((win as any).matchMedia) {
|
||||
if ((window as any).matchMedia) {
|
||||
const mediaQuery = SIZE_TO_MEDIA[breakpoint];
|
||||
return win.matchMedia(mediaQuery).matches;
|
||||
return window.matchMedia(mediaQuery).matches;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user