
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
storybook-theme-switch-addon
Advanced tools
Switch easily between multiple themes declared in your css files
This addon allows you to switch easily between multiple themes declared in your CSS files. It's especially useful in Tailwind CSS if you have more themes in separate files.
In addition, on every theme change, your URL updates with a query param that points currently selected theme.
The idea and code parts were inspired by storybook-stylesheet-toggle addon.
Install the package:
npm i storybook-theme-switch-addon
Add the next addon to your .storybook/main.(js,ts)
file:
module.exports = {
addons: ["storybook-theme-switch-addon"],
};
Configure your themes in .storybook/preview.(js,ts)
by adding globalTypes to preview object:
globalTypes: {
stylesheets: {
themes: [
{
id: "primary-theme",
title: "Primary theme",
url: "./primary-theme.css",
},
{
id: "secondary-theme",
title: "Secondary theme",
url: "./secondary-theme.css",
},
{
id: "tertiary-theme",
title: "Tertiary theme",
url: "./tertiary-theme.css",
},
],
},
},
Remember to configure your storybook to serve static files in public
directory:
const config: StorybookConfig = {
{...options},
staticDirs: ["../public"],
};
yarn start
runs babel in watch mode and starts Storybookyarn build
build and package your addon codeFAQs
Switch easily between multiple themes declared in your css files
We found that storybook-theme-switch-addon demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.