/astro-fouc-killer

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

Primary LanguageAstroGNU Affero General Public License v3.0AGPL-3.0

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].