storybook-addon-styled-component-theme
storybook addon with styled-components theme
Last updated 6 months ago by echoulen .
MIT · Original npm · Tarball · package.json
$ cnpm install storybook-addon-styled-component-theme 
SYNC missed versions from official npm registry.

npm version build status codecov

Notice

Support storybook v4, v5 and newer

Installation

yarn add storybook-addon-styled-component-theme --dev

Add to .storybook/addons.ts

// v1.3, storybook v5.2
import 'storybook-addon-styled-component-theme/dist/register';

// v1.2, storybook v4, v5.0
import 'storybook-addon-styled-component-theme/dist/src/register';

addDecorator to .storybook/config.ts

import {addDecorator} from '@storybook/react';
import {withThemesProvider} from 'storybook-addon-styled-component-theme';

const themes = [theme1, theme2];
addDecorator(withThemesProvider(themes));

or

addDecorator to stories

import {withThemesProvider} from 'storybook-addon-styled-component-theme';

const themes = [theme1, theme2];

storiesOf("demo", module)
  .addDecorator(withThemesProvider(themes))
  .add("demo div", () => <div>DEMO</div>);

Remind

Make sure every theme object has a name property

Contributing

yarn

yarn build

Run all the spec

yarn test

Current Tags

  • 1.3.0                                ...           latest (6 months ago)

18 Versions

  • 1.3.0                                ...           6 months ago
  • 1.2.5                                ...           9 months ago
  • 1.2.4                                ...           a year ago
  • 1.2.3                                ...           a year ago
  • 1.2.2                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6-fix2                                ...           2 years ago
  • 1.0.6-fix                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 3
This Week 12
This Month 3
Last Day 0
Last Week 3
Last Month 42
Dependencies (2)
Dev Dependencies (21)

Copyright 2014 - 2016 © taobao.org |