UNPKG

@wener/console

Version:
8 lines (7 loc) 285 B
export function getPrefersColorSchema() { var _window; if (typeof window === 'undefined') { return 'light'; } return ((_window = window) === null || _window === void 0 ? void 0 : _window.matchMedia('(prefers-color-scheme: dark)').matches) ? 'dark' : 'light'; }