Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: Scope styles in sample components from the CLI templates #22162

Merged
merged 8 commits into from
May 9, 2023

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Apr 19, 2023

Closes #19409 , Closes #12423

What I did

Redo of #19433, thank you so so much @Amerlander !

Added storybook specific classes to Page and Header components to prevent its CSS being applied to other elements.

This solution was discussed here before: #19410 (comment)

How to test

  1. Run a sandbox for template, e.g. yarn task --task sandbox --start-from auto --template react-vite/default-ts
  2. Open Storybook in your browser
  3. Access the basic CLI stories, they should not have changed (but their styles would not leak anymore!)

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

@yannbf yannbf added bug cli ci:daily Run the CI jobs that normally run in the daily job. labels Apr 19, 2023
Copy link
Contributor

@JReinhold JReinhold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a great and simple solution. 🎉

@yannbf yannbf added the patch:yes Bugfix & documentation PR that need to be picked to main branch label May 8, 2023
@yannbf yannbf merged commit 97ed646 into next May 9, 2023
@yannbf yannbf deleted the fix/scope-sample-styles branch May 9, 2023 08:20
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label May 9, 2023
shilman pushed a commit that referenced this pull request May 9, 2023
CLI: Scope styles in sample components from the CLI templates
@shilman shilman mentioned this pull request May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ci:daily Run the CI jobs that normally run in the daily job. cli patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Svelte Example Components injecting global CSS Storybook styles given higher precedence than project styles
4 participants