Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add preset.js #129

Merged
merged 1 commit into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ or with yarn:
yarn add -D storybook-dark-mode
```

Then, add the addon to your `.storybook/main.js`
Then, add following content to `.storybook/main.js`

```js
module.exports = {
addons: [
'storybook-dark-mode/register'
],
}
presets: ['storybook-dark-mode']
};
```

## Configuration
Expand Down Expand Up @@ -211,6 +209,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "storybook-dark-mode",
"version": "1.0.3",
"description": "Toggle between light and dark mode in Storybook v5",
"description": "Toggle between light and dark mode in Storybook",
"main": "dist/index.js",
"source": "index.ts",
"files": [
Expand All @@ -13,6 +13,10 @@
"name": "Andrew Lisowski",
"email": "[email protected]"
},
"keywords": [
"storybook-addons",
"appearance"
],
"repository": {
"type": "git",
"url": "https://github.com/hipstersmoothie/storybook-dark-mode"
Expand Down
5 changes: 5 additions & 0 deletions preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
managerEntries: (entry = []) => {
return [...entry, require.resolve('storybook-dark-mode/register')];
}
};