注意:開發中
Storybook 附加元件 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',
'tailwind-dark-mode', // 👈 register the addon here
],
};
export default config;