Skip to content

Commit

Permalink
Fix flash when selected theme is not set to OS theme
Browse files Browse the repository at this point in the history
Closes #1709
  • Loading branch information
Gerrit0 committed Oct 3, 2021
1 parent 33df459 commit 298de8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/output/themes/default/assets/typedoc/Theme.ts
Expand Up @@ -12,6 +12,9 @@ export function initTheme(choices: HTMLOptionElement) {
});
}

// Also see:
// - src/lib/output/themes/defaults/layouts/default.tsx
// - src/lib/utils/highlighter.tsx
function setTheme(theme: ThemeChoice) {
switch (theme) {
case "os":
Expand Down
1 change: 1 addition & 0 deletions src/lib/output/themes/default/layouts/default.tsx
Expand Up @@ -28,6 +28,7 @@ export const defaultLayout = (context: DefaultThemeRenderContext, props: PageEve
<script async src={context.relativeURL("assets/search.js")} id="search-script"></script>
</head>
<body>
<script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script>
{context.header(props)}

<div class="container container-main">
Expand Down

0 comments on commit 298de8a

Please sign in to comment.