Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/huntermacd/storybook-stylesheet-disable

A Storybook add-on that makes it easy to disable stylesheets.
https://github.com/huntermacd/storybook-stylesheet-disable

Last synced: 15 days ago
JSON representation

A Storybook add-on that makes it easy to disable stylesheets.

Awesome Lists containing this project

README

        

# Storybook Stylesheet Disable

A Storybook add-on that makes it easy to disable stylesheets.

## Getting Started

1. `yarn add --dev storybook-stylesheet-disable`
2. Add to your `main.js` config file:

```
module.exports = {
...,
addons: [
...,
"storybook-stylesheet-disable"
],
...,
};
```

3. Configure `stylesheetId` in `preview.js` within your `.storybook` directory:

```
export const globals = {
...,
stylesheetId: 'your-unique-id-here',
...,
};
```

4. Create a `preview-head.html` file within your `.storybook` directory if you don't already have one.
5. Add the stylesheets you wish to be disabled/enabled via `` tags, giving each one _the same unique identifier_ as a `title` attribute:

```

```

(This tool can operate in reverse, too, if you wish. Simply add the `disabled` attribute to the `` tags.)

6. Spin up Storybook and you should see a new toolbar button with the `< >` icon, which will disable/enable the specified stylesheets.