-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
FontSizePicker: Fix FontSizePicker Storybook control type and improve documentation #68936
FontSizePicker: Fix FontSizePicker Storybook control type and improve documentation #68936
Conversation
Hi, @t-hamano I have currently applied your fix and it seems to solve the issue but I am finding better possibilities. Meanwhile, if we find any better solutions, we can explore them here. |
746016f
to
32086da
Compare
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
LGTM 👍
What?
Closes: #68553
This PR fixes an issue with the FontSizePicker component in Storybook where changing the
units
prop was causing an error. It also clarifies the documentation around the component'sunitless mode
.Why?
When trying to change the units prop in Storybook, an error was occurring:
allowedUnitValues.includes is not a function
. This happened because clicking theSet object
button in Storybook initialized the value as an empty object instead of an array. Additionally, the documentation didn't clearly explain when theunits
prop would actually have an effect.How?
units
prop from the default toinline-check
with predefined optionsREADME
documentation to clearly explain the relationship betweenstring/number
font-size values and theunitless mode
Testing Instructions
npm run storybook:dev
FontSizePicker
componentunits
property only works when font sizes are specified as strings with unitsScreencast
Screen.Recording.2025-02-26.at.12.43.14.mov