storybookjs / frontpage

🌐 The website for storybook.js.org
https://storybook.js.org
MIT License
212 stars 116 forks source link

[tailwindcss]: SB CSS specificity overrides TW (or other frameworks) CSS #609

Open newtriks opened 8 months ago

newtriks commented 8 months ago

Details

Recipe Page: tailwindcss Recipe Template: tailwindcss Browser:

What is wrong

I was wondering why my mdx documentation styled with TW was only partially working. I realised it was specificity related then found:

https://github.com/storybookjs/storybook/issues/10817

Request to update docs with:

Please add a small note or gotcha section with a sentence stating that due to CSS specificity, certain styles maybe overridden in MDX files by the SB CSS and to work around this you should wrap content in a div with the sb-unstyled class.

🙏

Screenshots

😞

Screenshot 2023-10-26 at 16 01 19

😌

Screenshot 2023-10-26 at 16 01 34
ShaunEvening commented 8 months ago

Hey @newtriks 👋

This is a great call out <3 I'm going to add this to my to do this for early next week. Stay tuned 📻