Simplify theme setting in root
This commit is contained in:
parent
2fc6a521c3
commit
13b02c39a0
12
app/root.tsx
12
app/root.tsx
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user