File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,16 @@ const localeMap = locales.value.reduce(
2121 {} as Record <string , Directions >,
2222)
2323
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+
2434useHead ({
2535 htmlAttrs: {
2636 ' lang' : () => locale .value ,
@@ -30,6 +40,7 @@ useHead({
3040 titleTemplate : titleChunk => {
3141 return titleChunk ? titleChunk : ' npmx - Better npm Package Browser'
3242 },
43+ meta: [{ name: ' color-scheme' , content: colorScheme }],
3344})
3445
3546if (import .meta .server ) {
Original file line number Diff line number Diff line change @@ -301,8 +301,6 @@ export const CustomStyles = html`
301301 --ln-color-missing : var (--ln-color-black );
302302 --ln-color-outdated : # fb923c ;
303303 --ln-color-done : # c084fc ;
304-
305- color-scheme : dark;
306304 }
307305
308306 html {
You can’t perform that action at this time.
0 commit comments