UNPKG

@scalar/api-reference

Version:

Generate beautiful API references from OpenAPI documents

15 lines (14 loc) 536 B
//#region src/helpers/color-mode.ts /** * Gets the system color mode preference from the browser. * Falls back to 'light' if running in a non-browser environment. * * @returns The system preference for dark or light mode. */ var getSystemModePreference = () => { if (typeof window === "undefined" || typeof window?.matchMedia !== "function") return "light"; return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; }; //#endregion export { getSystemModePreference }; //# sourceMappingURL=color-mode.js.map