{"id":15061871,"url":"https://github.com/storybookjs/addon-styling","last_synced_at":"2025-10-04T21:31:44.615Z","repository":{"id":65515790,"uuid":"589332998","full_name":"storybookjs/addon-styling","owner":"storybookjs","description":"A base addon for configuring popular styling tools","archived":true,"fork":false,"pushed_at":"2023-09-01T12:08:17.000Z","size":2617,"stargazers_count":44,"open_issues_count":8,"forks_count":10,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-30T00:55:25.996Z","etag":null,"topics":["addon","css","postcss","scss","storybook","styling","theme-switcher"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/storybookjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-01-15T20:34:42.000Z","updated_at":"2024-07-15T14:06:14.000Z","dependencies_parsed_at":"2023-06-28T14:16:04.232Z","dependency_job_id":null,"html_url":"https://github.com/storybookjs/addon-styling","commit_stats":{"total_commits":100,"total_committers":10,"mean_commits":10.0,"dds":0.52,"last_synced_commit":"78cfb72eb561bc3a556d8452a8e67aaa28a3f790"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":"storybookjs/addon-kit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/storybookjs%2Faddon-styling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/storybookjs%2Faddon-styling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/storybookjs%2Faddon-styling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/storybookjs%2Faddon-styling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/storybookjs","download_url":"https://codeload.github.com/storybookjs/addon-styling/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235258470,"owners_count":18961367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["addon","css","postcss","scss","storybook","styling","theme-switcher"],"created_at":"2024-09-24T23:26:16.891Z","updated_at":"2025-10-04T21:31:44.100Z","avatar_url":"https://github.com/storybookjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"⚠️ **This addon is officially deprecated** ⚠️\n\nSince it's release, addon-styling has been a great way to get your styles configured in Storybook. However, as the addon quickly evolved, it became clear that it was trying to do too much. It was trying to be a configuration tool, a theming tool, and a housed bulky code mods as well. This made it difficult to maintain and added a lot of dependencies that most users didn't need.\n\nTo address this, I've split the addon into two separate addons, [`@storybook/addon-styling-webpack`](https://github.com/storybookjs/addon-styling-webpack) and [`@storybook/addon-themes`](https://github.com/storybookjs/storybook/tree/next/code/addons/themes). These addons are much more focused and will allow us to iterate on them more quickly.\n\n`@storybook/addon-styling-webpack` will be specifically for configuring your **Webpack based Storybooks** with popular tools like Tailwind, Post CSS, SCSS, Less, and Vanilla-extract.\n\n`@storybook/addon-themes` will be focused on providing and switching between multiple themes in Storybook regardless of what building tool that you use.\n\nI've also moved the codemods to a separate package so that they can be used through `npx`/ `yarn dlx` / `pnpm dlx` without having a bulky codemod staying in your `node_modules`.\n\nI've added a [migration guide](https://github.com/storybookjs/addon-styling/blob/main/MIGRATION.md) to help you migrate to the new addons. If you have any questions, please feel free to reach out to me on [Twitter](https://twitter.com/integrayshaun) or the support channel in the [Storybook Discord](https://discord.com/channels/486522875931656193/1035683992684478534).\n\nAll the best,\nShaun Evening\n\n---\n\n# `@storybook/addon-styling`\n\nGet started in Storybook 7 faster with popular styling tools.\n\n**Using Storybook 6?** Check out the [`release-0-3` branch](https://github.com/storybookjs/addon-styling/tree/release-0-3)\n\n![Toggling between themes](./.github/media/styles-addon.gif)\n\n## ✨ Features\n\n- 🤖 Zero-config for popular tools through codemods. [Read more](https://github.com/storybookjs/addon-styling/tree/main/docs/auto-configuration.md).\n- 🧩 Configuration templates for popular tools\n- ⚡️ Options for css modules, postCss, Sass, and Less\n- 🎨 Provide themes\n- 🔄 Toggle between multiple themes when more than one is provided\n- ❗️ Override theme at the component and story level through parameters\n\n## 🏁 Getting Started\n\nTo get started, **install the package** as a dev dependency\n\nyarn:\n\n```zsh\nyarn add -D @storybook/addon-styling\n```\n\nnpm:\n\n```zsh\nnpm install -D @storybook/addon-styling\n```\n\npnpm:\n\n```zsh\npnpm add -D @storybook/addon-styling\n```\n\nThen, **include the addon** in your `.storybook/main.js` file\n\n```diff\nmodule.exports = {\n  stories: [\n    \"../stories/**/*.stories.mdx\",\n    \"../stories/**/*.stories.@(js|jsx|ts|tsx)\",\n  ],\n  addons: [\n    \"@storybook/addon-essentials\",\n+   \"@storybook/addon-styling\"\n  ],\n};\n```\n\n### 👇 Tool specific configuration\n\nFor tool-specific setup, check out the recipes below\n\n- [`@emotion/styled`](https://github.com/storybookjs/addon-styling/tree/main/docs/getting-started/emotion.md)\n- [`@mui/material`](https://github.com/storybookjs/addon-styling/tree/main/docs/getting-started/material-ui.md)\n- [`bootstrap`](https://github.com/storybookjs/addon-styling/tree/main/docs/getting-started/bootstrap.md)\n- [`cssModules`](https://github.com/storybookjs/addon-styling/blob/main/docs/api.md#optionscssmodules)\n- [`less`](https://github.com/storybookjs/addon-styling/blob/main/docs/api.md#optionsless)\n- [`postcss`](https://github.com/storybookjs/addon-styling/blob/main/docs/api.md#optionspostcss)\n- [`sass`](https://github.com/storybookjs/addon-styling/blob/main/docs/api.md#optionssass)\n- [`styled-components`](https://github.com/storybookjs/addon-styling/tree/main/docs/getting-started/styled-components.md)\n- [`tailwind`](https://github.com/storybookjs/addon-styling/tree/main/docs/getting-started/tailwind.md)\n- [`vuetify@3.x`](./docs/api.md#writing-a-custom-decorator)\n\nDon't see your favorite tool listed? Don't worry! That doesn't mean this addon isn't for you. Check out the [\"Writing a custom decorator\"](https://github.com/storybookjs/addon-styling/blob/main/docs/api.md#writing-a-custom-decorator) section of the [api reference](https://github.com/storybookjs/addon-styling/blob/main/docs/api.md).\n\n### ❗️ Overriding theme\n\nIf you want to override your theme for a particular component or story, you can use the `theming.themeOverride` parameter.\n\n```js\nimport React from \"react\";\nimport { Button } from \"./Button\";\n\nexport default {\n  title: \"Example/Button\",\n  component: Button,\n  parameters: {\n    theming: {\n      themeOverride: \"light\", // component level override\n    },\n  },\n};\n\nconst Template = (args) =\u003e \u003cButton {...args} /\u003e;\n\nexport const Primary = Template.bind({});\nPrimary.args = {\n  primary: true,\n  label: \"Button\",\n};\n\nexport const PrimaryDark = Template.bind({});\nPrimaryDark.args = {\n  primary: true,\n  label: \"Button\",\n};\nPrimaryDark.parameters = {\n  theming: {\n    themeOverride: \"dark\", // Story level override\n  },\n};\n```\n\n## 🤝 Contributing\n\nIf you'd like to contribute to this addon, **THANK YOU**, I'd love your help 🙏\n\n### 📝 Development scripts\n\n- `yarn start` runs babel in watch mode and starts Storybook\n- `yarn build` build and package your addon code\n\n### 🌲 Branch structure\n\n- **next** - the `next` version on npm, and the development branch where most work occurs\n- **main** - the `latest` version on npm and the stable version that most users use\n\n### 🚀 Release process\n\n1. All PRs should target the `next` branch, which depends on the `next` version of Storybook.\n2. When merged, a new version of this package will be released on the `next` NPM tag.\n3. If the change contains a bugfix that needs to be patched back to the stable version, please note that in PR description.\n4. PRs labeled `pick` will get cherry-picked back to the `main` branch and will generate a release on the `latest` npm tag.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstorybookjs%2Faddon-styling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstorybookjs%2Faddon-styling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstorybookjs%2Faddon-styling/lists"}