Expand description
Β§π¬ Demo
Β§π Intro
Theme is a flexible, declarative, and type-safe theming system for Rust-based WASM frameworks like Yew, Leptos, and Dioxus. It provides structured and composable themes, including support for dark/light/system themes and custom color palettes with runtime composition and validation.
Β§π€ Why Use Theme?
-
π Light, Dark, and System Themes: Built-in support for light, dark, and system-preferred themes.
-
π¨ Custom Themes with Composition: Define your own themes with optional inheritance from base themes.
-
π§ͺ Type-Safe Color Tokens: Validate hex codes at runtime.
-
π¦ Persistent Theme Selection: Persist user-selected themes using
LocalStorage
orSessionStorage
. -
β»οΈ Runtime Composition with Inheritance: Inherit and override from base themes dynamically at runtime.
-
ποΈ Tailwind & DaisyUI Compatible: Use custom themes to generate CSS variables that integrate smoothly with Tailwind CSS and DaisyUI.
Β§Yew Usage
Refer to our guide to integrate this component into your Yew app.
§𧬠Dioxus Usage
Refer to our guide to integrate this component into your Dioxus app.
Β§π± Leptos Usage (TODO)
Refer to our guide to integrate this component into your Leptos app.
Β§π€ Contributions
Contributions are welcome! Whether itβs bug fixes, feature requests, or examples, we would love your help to make Theme better.
- Fork the repository.
- Create a new branch for your feature/bugfix.
- Submit a pull request for review.
Β§π License
Theme is licensed under the MIT License. You are free to use, modify, and distribute this library in your projects.
Re-exportsΒ§
pub use common::ColorTokens;
pub use common::CustomTheme;
pub use common::StorageType;
pub use common::Theme;