Skip to content

Eliminate Dark Mode FOUC (Flash Of Unstyled Content) in Astro. Works with class based dark modes set in local storage and supports system preference.

License

Notifications You must be signed in to change notification settings

AVGVSTVS96/astro-fouc-killer

Repository files navigation

astro-fouc-killer

This is an Astro integration that eliminates FOUC (Flash Of Unstyled Content) by injecting an inline script that sets the 'dark' class on the document element before the page is rendered. The script gets the local storage value or, if one isn't provided, uses system preference to determine the theme.

This package is structured as a monorepo:

  • playground contains code for testing the package
  • package contains the actual package

To see how to get started, check out the package README

Licensing

AGPL-3.0 Licensed. Made with ❤️ by Bassim [AVGVSTVS96].

About

Eliminate Dark Mode FOUC (Flash Of Unstyled Content) in Astro. Works with class based dark modes set in local storage and supports system preference.

Topics

Resources

License

Stars

Watchers

Forks