[READ-ONLY] a fast, modern browser for the npm registry
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: set color scheme meta data value based on user settings (#689)

authored by

Thomas Deinhamer and committed by
GitHub
348de9c0 4fb4f113

+11 -2
+11
app/app.vue
··· 21 21 {} as Record<string, Directions>, 22 22 ) 23 23 24 + const darkMode = usePreferredDark() 25 + const colorMode = useColorMode() 26 + const colorScheme = computed(() => { 27 + return { 28 + system: darkMode ? 'dark light' : 'light dark', 29 + light: 'only light', 30 + dark: 'only dark', 31 + }[colorMode.preference] 32 + }) 33 + 24 34 useHead({ 25 35 htmlAttrs: { 26 36 'lang': () => locale.value, ··· 30 40 titleTemplate: titleChunk => { 31 41 return titleChunk ? titleChunk : 'npmx - Better npm Package Browser' 32 42 }, 43 + meta: [{ name: 'color-scheme', content: colorScheme }], 33 44 }) 34 45 35 46 if (import.meta.server) {
-2
lunaria/styles.ts
··· 301 301 --ln-color-missing: var(--ln-color-black); 302 302 --ln-color-outdated: #fb923c; 303 303 --ln-color-done: #c084fc; 304 - 305 - color-scheme: dark; 306 304 } 307 305 308 306 html {