Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ useHead({
'lang': () => locale.value,
'dir': () => localeMap[locale.value] ?? 'ltr',
'data-kbd-hints': () => showKbdHints.value,
/**
* npmx default theme is dark. But on initial load we don't know the user's preference yet.
* Without this attribute being set here, no theme gets loaded, regardless of user's preference,
* and a white page flashes before the correct theme is applied. Setting it to 'light' here
* doesn't prevent the flash of white page for dark mode users, but at least the page doesn't
* look broken while loading and white mode users get the correct theme immediately.
*/
'data-theme': () => 'light',
},
titleTemplate: titleChunk => {
return titleChunk ? titleChunk : 'npmx - Better npm Package Browser'
Expand Down
Loading