MCPcopy Create free account
hub / github.com/astercloud/aster / getSystemTheme

Function getSystemTheme

ui/src/composables/useDarkMode.ts:15–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13
14 // 检测系统主题
15 const getSystemTheme = (): "light" | "dark" => {
16 if (typeof window === "undefined") return "light";
17 return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
18 };
19
20 // 应用主题
21 const applyTheme = (newTheme: Theme) => {

Callers 1

applyThemeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected