1.0.22 • Published 1 year ago
storybook-tailwind-dark-mode v1.0.22
storybook-tailwind-dark-mode
Installation
Install the following npm module:
npm i --save-dev storybook-tailwind-dark-mode
or with yarn:
yarn add -D storybook-tailwind-dark-mode
Then, add following content to .storybook/main.js
module.exports = {
addons: ['storybook-tailwind-dark-mode'],
};
Make sure tailwind is configured to use the darkmode class in the tailwind.config.js
module.exports = {
darkMode: 'class',
// ...
}
Set Dark Mode as default
To set dark mode as default, Add the following lines of code to your preview.js file
const preview = {
globalTypes: {
darkMode: {
defaultValue: true, // Enable dark mode by default on all stories
},
// Optional (Default: 'dark')
className: {
defaultValue: 'custom-classname', // Set your custom dark mode class name
},
},
};
1.0.19
1 year ago
1.0.20-canary.264fe1a.0
1 year ago
1.0.18
1 year ago
1.0.17
1 year ago
1.0.16
1 year ago
1.0.19-canary.17.9307a98.0
1 year ago
1.0.22
1 year ago
1.0.21
1 year ago
1.0.18-canary.16.6248611.0
1 year ago
1.0.20
1 year ago
1.0.15
2 years ago
1.0.14
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
1.0.11
3 years ago
1.0.10
3 years ago
1.0.9
3 years ago
1.0.8
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.5
3 years ago