fix(col): col no longer errors when running in non-browser environment (#24603)

resolves #24446

Co-authored-by: Sean Perkins <sean@ionic.io>
This commit is contained in:
Liam DeBeasi
2022-01-19 16:03:53 -05:00
committed by GitHub
parent 360643d96a
commit af0135ce7d

View File

@ -3,8 +3,8 @@ import { Component, ComponentInterface, Host, Listen, Prop, forceUpdate, h } fro
import { getIonMode } from '../../global/ionic-global';
import { matchBreakpoint } from '../../utils/media';
const win = window as any;
const SUPPORTS_VARS = !!(win.CSS && win.CSS.supports && win.CSS.supports('--a: 0'));
const win = (typeof (window as any) !== 'undefined') ? window as any : undefined;
const SUPPORTS_VARS = win && !!(win.CSS && win.CSS.supports && win.CSS.supports('--a: 0'));
const BREAKPOINTS = ['', 'xs', 'sm', 'md', 'lg', 'xl'];
@Component({