Small preload script after document load but before page load
I'm trying to port the theme toggle from tailwindcss.com to Solid.js. I'm getting stuck at this part. The following script:
needs to load after the base document loads in order to read localstorage but before the page elements load to prevent a theme change flash. (See the tailwind implementation https://github.com/tailwindlabs/tailwindcss.com/blob/master/src/pages/_document.js)
I tried adding a script inside the
But it didn't work and I got no log in the console.
Could anyone point me to the direction to add a custom script at this point in the page render?
needs to load after the base document loads in order to read localstorage but before the page elements load to prevent a theme change flash. (See the tailwind implementation https://github.com/tailwindlabs/tailwindcss.com/blob/master/src/pages/_document.js)
I tried adding a script inside the
Head tags from Solid.js like this: But it didn't work and I got no log in the console.
Could anyone point me to the direction to add a custom script at this point in the page render?
