-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
docs(addon-controls): custom matchers are no longer default #18726
Conversation
A PR at storybookjs#14182 removed the default custom regex matchers for colors and dates Controls, and instead added them to the generated output from the CLI. However the docs don't reflect this change, and felt quite confusing for me working in a project that didn't use a recent version of the CLI, and therefore didn't have the "default" matchers from the CLI. I've tried to change the wording to reflect that they are only "defaults" if the reader actually sees them in the `.storybook/preview.js` file. I'm open to inputs on wording, or basically anything.
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 8cc06ac. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
|
||
| Data type | Default regex | Description | | ||
| :-------: | :-----------------------: | :-------------------------------------------------------: | | ||
| **color** | `/(background\|color)$/i` | Will display a color picker UI for the args that match it | | ||
| **color** | `/(background|color)$/i` | Will display a color picker UI for the args that match it | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a regex typo to me, but a pretty weird one so I might be wrong on that. It works without the \
, but not with.
Hey @JReinhold thanks for your contribution! That makes total sense. I'll let @kylegach give his opinion to get this going! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JReinhold, just a small tweak to this, and this should be good to go on my end. Thanks for following up on that pull request and updating the documentation accordingly. Appreciate it.
Let me know once it's done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JReinhold, thanks for addressing the feedback so promptly. Appreciate it. On my end, this is good and going to merge it.
docs(addon-controls): custom matchers are no longer default
Issue:
A PR at #14182 removed the default custom regex matchers for colors and dates Controls, and instead made the CLI generate the matchers in the preview configuration when initialising Storybook.
However the docs don't reflect this change, and felt quite confusing for me working in a project that didn't use a recent version of the CLI to initialise the project, and therefore didn't have the "default" matchers from the CLI.
What I did
I've tried to change the wording to reflect that they are only "defaults" if the reader actually sees them in their
.storybook/preview.js
file.I'm open to inputs on wording, or basically anything.