Skip to content

Commit 13e818f

Browse files
committed
Add note about instant switching
1 parent 063325a commit 13e818f

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,19 @@ themeSwitcher.addEventListener('change', () => {
150150
+ }
151151
```
152152

153+
**Step 7:** Think of adding a small inline JS to prevent [FART] completely.
154+
155+
```html
156+
<script defer>
157+
if (localStorage.theme === 'light') {
158+
html.classList.add('is-light')
159+
} else if (localStorage.theme === 'dark') {
160+
html.classList.add('is-dark')
161+
}
162+
</script>
163+
</head>
164+
```
165+
153166
[official docs]: https://github.com/postcss/postcss#usage
154167

155168

0 commit comments

Comments
 (0)