Skip to content

Commit

Permalink
Added a step to add :root[class~="dark"] to globals.css for next js
Browse files Browse the repository at this point in the history
Dark mode styles aren't applied if `:root[class~="dark"]` is not added to `globals.css`.
  • Loading branch information
aadeexyz authored Jan 2, 2025
1 parent 1081536 commit 9403a0d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions apps/www/content/docs/dark-mode/next.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ description: Adding dark mode to your next app.
## Dark mode

<Steps>
### Modify your tailwind.css file

Add `:root[class~="dark"]` to your globals.css file. This will allow you to use the `dark` class on your html element to apply dark mode styles.

```css {2} title="app/globals.css"
.dark,
:root[class~="dark"] {
...;
}
```

### Install next-themes

Expand Down

0 comments on commit 9403a0d

Please sign in to comment.