File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,14 @@ useHead({
3636 ' lang' : () => locale .value ,
3737 ' dir' : () => localeMap [locale .value ] ?? ' ltr' ,
3838 ' data-kbd-hints' : () => showKbdHints .value ,
39+ /**
40+ * npmx default theme is dark. But on initial load we don't know the user's preference yet.
41+ * Without this attribute being set here, no theme gets loaded, regardless of user's preference,
42+ * and a white page flashes before the correct theme is applied. Setting it to 'light' here
43+ * doesn't prevent the flash of white page for dark mode users, but at least the page doesn't
44+ * look broken while loading and white mode users get the correct theme immediately.
45+ */
46+ ' data-theme' : () => ' light' ,
3947 },
4048 titleTemplate : titleChunk => {
4149 return titleChunk ? titleChunk : ' npmx - Better npm Package Browser'
You can’t perform that action at this time.
0 commit comments