1.3.7 • Published 8 months ago

@storybook/addon-styling v1.3.7

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@storybook/addon-styling

Get started in Storybook faster with popular styling tools.

Toggling between themes

✨ Features

  • 🧩 Configuration templates for popular tools
  • 🎨 Provide themes
  • 🔄 Toggle between multiple themes when more than one is provided
  • ❗️ Override theme at the component and story level through parameters

🏁 Getting Started

To get started, install the package as a dev dependency

yarn:

yarn add -D @storybook/addon-styling

npm:

npm install -D @storybook/addon-styling

pnpm:

pnpm add -D @storybook/addon-styling

Then, include the addon in your .storybook/main.js file

module.exports = {
  stories: [
    "../stories/**/*.stories.mdx",
    "../stories/**/*.stories.@(js|jsx|ts|tsx)",
  ],
  addons: [
    "@storybook/addon-essentials",
+   "@storybook/addon-style-config"
  ],
};

👇 Tool specific configuration

For tool-specific setup, check out the recipes below

Don'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" section of the api reference.

❗️ Overriding theme

If you want to override your theme for a particular component or story, you can use the theming.themeOverride parameter.

import React from "react";
import { Button } from "./Button";

export default {
  title: "Example/Button",
  component: Button,
  parameters: {
    theming: {
      themeOverride: "light", // component level override
    },
  },
};

const Template = (args) => <Button {...args} />;

export const Primary = Template.bind({});
Primary.args = {
  primary: true,
  label: "Button",
};

export const PrimaryDark = Template.bind({});
PrimaryDark.args = {
  primary: true,
  label: "Button",
};
PrimaryDark.parameters = {
  theming: {
    themeOverride: "dark", // Story level override
  },
};

🤝 Contributing

If you'd like to contribute to this addon, THANK YOU, I'd love your help 🙏

📝 Development scripts

  • yarn start runs babel in watch mode and starts Storybook
  • yarn build build and package your addon code
districtr-mapbox-glbarely-human-library@everything-registry/sub-chunk-875nextra-docs-demomo-react-ui@amalitech-org/design-systemfree-beeexperimental-bahmni-next-uiffn-core-componentsfn-core-componentsfbeyzak-ui-libraryhfn-core-admin-componentsldnc-uilx-taro-storybook-helperls-core-componentsmobase-testmo-react-ui-testoa-componentbookpluzchat-design-systempayabl-ui-librarynextra-docs-demoonextra-docs-template-demo-2nextra-docs-template-demo1nextra-docs-test-demonextra-docs-test-demo2rmscomponentsrn-core-componentsui-sil-components2themepublishv1topty-component-web-libthe-handsomestnerd-internaltitan.designsystemstorybook-aeravases-uiux-sil-componentsux-sil-components-betaux-sil-components2visyn_scriptstsr-ui@ada-h/homebase-integration@aivenio/aquarium@alicd/storybook-config-cone@asad1381/custom-components@blogwebpl/ui@draftit-ui/core@youpal-design-system/design-system@zimyo/componentsadmin-core-componentsara-crom-components-libastraui-tailwind@cruk/chakra-componentsbh-ui@gargalo/ui-kit@goddardsystems/web-component-library@ehsanabdolrashidi/react-basic-elements@hovo2003/design-system@hovo2003/gag@nds_core/nds@niranjan821/journey-demo@marimo-team/frontend@marimo-team/frontend-wasm@marimo-team/islands@leoj_anidem/toast-notify@itgold/grandbazar-ui-kit@momo-webplatform/mobase@m_v_c_1198/journey@m_v_c_1198/viewers@moda/om@mitalic/view@mitalic/viewers@mitalic/journey@mitalic/journey-app@mitalic/journey1@simuratli/uds@shubh799/homebase@shubh799/homebase-integration@shubh799/journey@shubh799/viewers@procore/storybook-addon@solussaude-ui/docs@stn-ui/storybookbahmni-carbon-uidesign-system-zeroz
2.0.2-next.3

9 months ago

2.0.2-next.4

9 months ago

2.0.2-next.1

10 months ago

1.3.7

8 months ago

1.3.6

9 months ago

1.3.5

9 months ago

1.3.4

10 months ago

1.3.3

10 months ago

1.3.2

10 months ago

1.3.1

10 months ago

1.2.0

11 months ago

1.1.0

11 months ago

1.3.0

11 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.6

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

2.0.0

1 year ago

1.0.0-next.0

1 year ago

1.0.0-next.1

1 year ago

1.0.0-next.2

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.2-next.1

1 year ago

0.3.3-next.0

1 year ago

0.3.2-next.0

1 year ago

0.3.0

1 year ago

0.2.1

1 year ago

0.1.0

1 year ago

0.2.0

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago