misskey-awawa/packages/client/src/scripts/is-device-darkmode.ts

4 lines
106 B
TypeScript

export function isDeviceDarkmode() {
return window.matchMedia('(prefers-color-scheme: dark)').matches;
}