Switch easily between multiple themes declared in your CSS files.
Overview
The Storybook theme/stylesheet switcher addon is a game-changer for developers who work with multiple themes in their projects. Especially beneficial for those using Tailwind CSS, this addon simplifies the process of switching between various themes defined in CSS files. This not only enhances the development experience but also provides a seamless way to visualize changes in different styles without navigating through a complex setup.
One of the standout features of this addon is its ability to update the browser’s URL to reflect the currently selected theme. This functionality is particularly useful for teams and clients alike, as it allows for easy sharing and references to specific themes in demonstrations or testing environments.
Features
- Multiple Theme Support: Easily toggle between different themes defined in separate CSS files, making it perfect for projects with diverse styling needs.
- Tailwind CSS Integration: Designed with Tailwind CSS in mind, this addon complements the utility-first approach of the framework seamlessly.
- URL Query Parameter Update: Automatically updates the URL with a query parameter indicating the currently selected theme, ensuring easy sharing and referencing.
- Simple Installation: Quickly install the addon and configure via the .storybook/main.js file for a hassle-free setup.
- Static File Support: Configurable to serve static files, ensuring that all necessary resources are easily accessible during development.
- Development Automation: Use yarn scripts to run your Storybook in watch mode or build and package your addon code efficiently.
- Inspired by Existing Tools: Builds upon the popular storybook-stylesheet-toggle addon, providing a robust and reliable option for theme switching.