Storybook Addon Tailwind Dark
一个用于在 Storybook v8 中切换 Tailwind 暗黑主题的插件
安装
首先,安装软件包。
npm install --save-dev storybook-addon-tailwind-dark
然后,在 .storybook/main.js
中将其注册为插件。
// .storybook/main.ts
// Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite)
import type { StorybookConfig } from '@storybook/react';
const config: StorybookConfig = {
// ...rest of config
addons: [
'@storybook/addon-essentials',
'storybook-addon-tailwind-dark', // 👈 register the addon here
],
};
export default config;