You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/README.md
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,18 +11,33 @@ The `nextjs-themes` library was initially created to achieve a similar functiona
11
11
## Features
12
12
13
13
- ✅ Simple API to toggle between dark and light modes
14
+
14
15
- ✅ 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
+
16
21
- ✅ Fully treeshakable (e.g., `import from nextjs-darkmode/hooks`)
22
+
17
23
- ✅ Full TypeScript support
24
+
18
25
- ✅ Utilizes React 18 Server components
26
+
19
27
- ✅ Compatible with all React 18 build systems/tools/frameworks
28
+
20
29
- ✅ System setting with `prefers-color-scheme`
30
+
21
31
- ✅ Supports Next.js 13 & 14 `appDir`
32
+
22
33
- ✅ No flash on load (supports SSG, SSR, ISG, and Server Components)
34
+
23
35
- ✅ Sync theme across tabs and windows
36
+
24
37
- ✅ Apply custom transitions when changing themes
38
+
25
39
- ✅ Manipulate theme via the `useMode` hook
40
+
26
41
- ✅ No cookies when not using the corresponding `ServerTarget`
27
42
28
43
- ✅ Comprehensive documentation with [Typedoc](https://react18-tools.github.io/nextjs-darkmode)
@@ -190,6 +205,14 @@ When using `ServerTarget`, use the CSS general sibling combinator (~):
190
205
191
206
`data-sm` -> System preference
192
207
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.
0 commit comments