Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Simplify theme setting in root
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 2fc6a52 commit 13b02c3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/root.tsx
Expand Up @@ -165,14 +165,18 @@ function getMarkup(

return (
<html
data-theme={loaderData.theme}
lang="en-US"
{...(loaderData.theme && {
"data-theme": loaderData.theme,
style: { colorScheme: loaderData.theme },
})}
>
<head>
<Links />
<style nonce={loaderData.nonce}>
{`
:root {
color-scheme: ${loaderData.theme};
}
`}
</style>
{serverStyleData?.map(({ key, ids, css }) => (
<style
key={key}
Expand Down

0 comments on commit 13b02c3

Please sign in to comment.