0.1.0 • Published 7 months ago

@enapter/design-theme v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

Enapter Design Theme Provider

Dark Theme

Modify [data-theme="dark"] attribute in <html> tag to change color palettes (light/dark mode) by using:

// Use this on the top of scripts
// to apply 'system' or 'dark' (if saved previously) theme.

initTheme();
// Use this in any place
// to toggle light/dark theme.

toggleTheme();
// Use this in any place
// to set light or dark theme manually.

setThemeLight();
setThemeDark();

Read more →

Astro.js

Install the Enapter Design Theme Astro Integration:

npm i @enapter/design-theme

astro.config.mjs

import { defineConfig } from "astro/config";

import tailwind from "@astrojs/tailwind";
import enapterTheme from "@enapter/design-theme/astro";

export default defineConfig({
    // ...
    integrations: [tailwind(), enapterTheme()],
})

AnyComponent.astro

<script is:inline>
    document
        .querySelectorAll("[data-id=toggle-dark-mode-button]")
        .forEach((btn) => {
            btn.addEventListener("click", toggleTheme);
        });
</script>
0.1.0

7 months ago

0.0.9

7 months ago

0.0.8

7 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago