Sequence
docs
Astro components

Theme provider

Script for handling light/dark mode.

An inline script component that initializes the color theme (light or dark) based on local storage or system preference.

Usage

In your main layout (e.g., Layout.astro):

---
import ThemeProvider from '@/components/ThemeProvider.astro';
---

<head>
  <ThemeProvider />
  <!-- ... -->
</head>

On this page