param { Function } callback export function debug ( callback ) { if ( process . env . NODE_ENV !== 'production' ) { callback ( ) ; } } param { String } color export function setThemeColor ( color ) { document . querySelector ( 'meta[name="theme-color"]' ) . setAttribute ( 'content' , color ) ; } returns { boolean } export function isSystemPrefersThemeSupport ( ) { return window . matchMedia && window . matchMedia ( `(prefers-color-scheme)` ) . matches ; } returns { SystemThemeCodes } export function systemPrefersTheme ( ) { if ( _checkThemeMedia ( 'dark' ) ) { return SystemThemeCodes . dark ; } else if ( _checkThemeMedia ( 'light' ) ) { return SystemThemeCodes . light ; } return SystemThemeCodes . noSupport ; } param { String } color function _checkThemeMedia ( color ) { return window . matchMedia && window . matchMedia ( `(prefers-color-scheme: ${ color })` ) . matches ; } /**
 * Result codes for systemPrefersTheme
 */ export enum SystemThemeCodes { noSupport , dark , light }