Skip to content

Commit

Permalink
Global styles should always come first
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Jul 14, 2023
1 parent 65f87da commit 1504d7a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/next/appDir.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,21 @@ export function NextAppDirEmotionCacheProvider(

return (
<>
{styles !== "" && (
{globalStyles !== "" && (
<style
key={cache.key}
data-emotion={dataEmotionAttribute}
key={`${cache.key}-global`}
data-emotion={globalDataEmotionAttribute}
dangerouslySetInnerHTML={{
"__html": styles
"__html": globalStyles
}}
/>
)}
{globalStyles !== "" && (
{styles !== "" && (
<style
key={`${cache.key}-global`}
data-emotion={globalDataEmotionAttribute}
key={cache.key}
data-emotion={dataEmotionAttribute}
dangerouslySetInnerHTML={{
"__html": globalStyles
"__html": styles
}}
/>
)}
Expand Down

0 comments on commit 1504d7a

Please sign in to comment.