Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

(feat): Add postcss support to webpack storybooks #3

Merged
merged 5 commits into from
Feb 23, 2023

Conversation

ShaunEvening
Copy link
Contributor

@ShaunEvening ShaunEvening commented Feb 16, 2023

What changed

  • Add support to add PostCSS into the webpack build

How to test

  • Have a postcss.config.js file
module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  },
};
  • Import your global tailwind css file into .storybook/preview.js
  • Run yarn add -D @storybook/addon-styling@0.2.0-canary.3.524da34.0
  • Register the addon in .storybook/main.js
module.exports = {
  stories: [
    "../stories/**/*.stories.mdx",
    "../stories/**/*.stories.@(js|jsx|ts|tsx)",
  ],
  addons: [
    "@storybook/addon-essentials",
+   {
+     name: "@storybook/addon-styling",
+     options: {
+       postCss: true,
+     },
+   },
  ],
};
  • start Storybook

Still failed? what was your error?

📦 Published PR as canary version: 0.2.0-canary.3.524da34.0

✨ Test out this PR locally via:

npm install @storybook/addon-styling@0.2.0-canary.3.524da34.0
# or 
yarn add @storybook/addon-styling@0.2.0-canary.3.524da34.0

@ShaunEvening ShaunEvening added the minor Increment the minor version when merged label Feb 16, 2023
@ShaunEvening ShaunEvening self-assigned this Feb 16, 2023
@ShaunEvening
Copy link
Contributor Author

If you test this and it works for you, comment below to let me know the framework and storybook version you tried it on.

If it doesn't work, comment below to let me know the framework and storybook version you tried it on along with the error information that you got.

Thank you for your help, friends 🙏

@ShaunEvening ShaunEvening changed the title First go add adding postcss to webpack (feat): Add postcss support to webpack storybooks Feb 17, 2023
@ShaunEvening ShaunEvening marked this pull request as ready for review February 21, 2023 17:59
@ShaunEvening ShaunEvening merged commit 62d3a02 into main Feb 23, 2023
@ShaunEvening ShaunEvening deleted the add-postcss-option branch February 23, 2023 21:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
minor Increment the minor version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant