Skip to content

Commit 40c96ed

Browse files
authored
Update README.md (#24)
`defer` makes no sense for the inline scripts. Please see: https://html.spec.whatwg.org/multipage/scripting.html#htmlscriptelement:~:text=are%20affected%20by%20the%20async%20and%20defer%20attributes%2C%20but%20only%20when%20the%20src%20attribute%20is%20set (And even if it worked, that rather would be harmful as the deferred scripts are executed out-of-sync with the first paint)
1 parent da6ae00 commit 40c96ed

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ themeSwitcher.addEventListener('change', () => {
153153
**Step 7:** Think of adding a small inline JS to prevent [FART] completely.
154154

155155
```html
156-
<script defer>
156+
<script>
157157
if (localStorage.theme === 'light') {
158158
html.classList.add('is-light')
159159
} else if (localStorage.theme === 'dark') {

0 commit comments

Comments
 (0)