0.1.2 • Published 1 year ago

@enapter/design-theme v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year 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.2

1 year ago

0.1.1

1 year ago

0.1.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago