Skip to content

Commit 09d23a1

Browse files
committed
Apply changesets and update CHANGELOG
1 parent 3a5680d commit 09d23a1

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

lib/README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,33 @@ The `nextjs-themes` library was initially created to achieve a similar functiona
1111
## Features
1212

1313
- ✅ Simple API to toggle between dark and light modes
14+
1415
- ✅ Perfect dark mode with just 2 lines of code
15-
- ✅ Compatible with Tailwind CSS
16+
17+
- ✅ Compatible with Tailwind CSS, StyledComponents, emotion, Material UI, ...
18+
19+
- ✅ Secure by design - we support `nonce` when you want to apply Content Security Policy
20+
1621
- ✅ Fully treeshakable (e.g., `import from nextjs-darkmode/hooks`)
22+
1723
- ✅ Full TypeScript support
24+
1825
- ✅ Utilizes React 18 Server components
26+
1927
- ✅ Compatible with all React 18 build systems/tools/frameworks
28+
2029
- ✅ System setting with `prefers-color-scheme`
30+
2131
- ✅ Supports Next.js 13 & 14 `appDir`
32+
2233
- ✅ No flash on load (supports SSG, SSR, ISG, and Server Components)
34+
2335
- ✅ Sync theme across tabs and windows
36+
2437
- ✅ Apply custom transitions when changing themes
38+
2539
- ✅ Manipulate theme via the `useMode` hook
40+
2641
- ✅ No cookies when not using the corresponding `ServerTarget`
2742

2843
- ✅ Comprehensive documentation with [Typedoc](https://react18-tools.github.io/nextjs-darkmode)
@@ -190,6 +205,14 @@ When using `ServerTarget`, use the CSS general sibling combinator (~):
190205

191206
`data-sm` -> System preference
192207

208+
#### Content Security Policy
209+
210+
If you are using CSP rules for CSS files, you can pass `nonce` argument to the `Core` component. If `nonce` is not supplied transition styles will not be applied. This may allow patched transitions throught the page in some cases.
211+
212+
```tsx
213+
<Core nonce={yourNonce} t="transition: all .5s" />
214+
```
215+
193216
### Images
194217

195218
Show different images based on the current theme:

0 commit comments

Comments
 (0)