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: README.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,7 +155,7 @@ An elegant color switch to toggle color schemes:
155
155
156
156
Fully support dark mode, including system preference with `prefers-color-scheme`. The dark/light mode is synced between tabs and modifies the `className` and data-attributes on the `html` or ServerTarget element:
157
157
158
-
````css
158
+
```css
159
159
:root {
160
160
--background: white;
161
161
--foreground: black;
@@ -169,7 +169,7 @@ Fully support dark mode, including system preference with `prefers-color-scheme`
169
169
/* or */
170
170
171
171
[data-rm="dark"] {...}
172
-
172
+
```
173
173
174
174
When using `ServerTarget`, use the CSS general sibling combinator (~):
175
175
@@ -182,10 +182,12 @@ When using `ServerTarget`, use the CSS general sibling combinator (~):
182
182
}
183
183
```
184
184
185
-
#### dataattributes
185
+
#### Using the data-attributes
186
186
187
187
`data-rm` -> Resolved Mode
188
+
188
189
`data-m` -> User's preference
190
+
189
191
`data-sm` -> System preference
190
192
191
193
### Images
@@ -335,4 +337,3 @@ Please consider enrolling in [our courses](https://mayank-chaudhari.vercel.app/c
335
337
<hr />
336
338
337
339
<palign="center"style="text-align:center">with 💖 by <ahref="https://mayank-chaudhari.vercel.app"target="_blank">Mayank Kumar Chaudhari</a></p>
0 commit comments