0.1.2 • Published 2 years ago

storybook-addon-css-toggler v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Storybook Addon css-toggler

Allows you to toggle css files on the storybook preview iframe.

How to use

Install the addon:

yarn add -D storybook-addon-css-toggler

Add your configuration to the preview.ts file:

import type { Preview } from "@storybook/react";
import blue from "../css/blue.css?inline";
import red from "../css/red.css?inline";

const preview: Preview = {
    parameters: {
        cssToggler: {
            stylesheets: [
                {
                    id: "red",
                    title: "Red",
                    content: red,
                },
                {
                    id: "blue",
                    title: "Blue",
                    content: blue,
                },
            ],
        },
    },
};

Add the addon to the storybook main.ts file:

...
addons: [
    "storybook-addon-css-toggler",
  ],
...
0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.0

2 years ago