Skip to content

Commit

Permalink
add preset.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hipstersmoothie committed Dec 15, 2020
1 parent c9b6ea6 commit fe3cb46
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ or with yarn:
yarn add -D storybook-dark-mode
```

Then, add following content to .storybook/addons.js
Then, add following content to `.storybook/main.js`

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

## Configuration
Expand Down Expand Up @@ -213,6 +215,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.1",
"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 @@ -12,6 +12,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('./register')];
}
};

0 comments on commit fe3cb46

Please sign in to comment.