Browse Source

feat: browserBlack state

richard1015 4 years ago
parent
commit
f04fec111d
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/sites/assets/util/ref.ts

+ 8 - 0
src/sites/assets/util/ref.ts

@@ -1,4 +1,12 @@
 import { Ref, ref } from 'vue';
+
+const browserBlack = () => {
+  return (
+    window.matchMedia &&
+    window.matchMedia('(prefers-color-scheme: dark)').matches
+  );
+};
+
 export class RefData {
   private static instance: RefData;
   public static getInstance(): RefData {