Skip to content

Commit

Permalink
Add note about instant switching
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Aug 15, 2023
1 parent 063325a commit 13e818f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,19 @@ themeSwitcher.addEventListener('change', () => {
+ }
```

**Step 7:** Think of adding a small inline JS to prevent [FART] completely.

```html
<script defer>
if (localStorage.theme === 'light') {
html.classList.add('is-light')
} else if (localStorage.theme === 'dark') {
html.classList.add('is-dark')
}
</script>
</head>
```

[official docs]: https://github.com/postcss/postcss#usage


Expand Down

0 comments on commit 13e818f

Please sign in to comment.