-
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
Storybook: Add story for TypographyPanel #35293
Conversation
Size Change: 0 B Total Size: 1.07 MB ℹ️ View Unchanged
|
packages/components/src/tools-panel/stories/typography-panel.js
Outdated
Show resolved
Hide resolved
import { | ||
__experimentalFontAppearanceControl as FontAppearanceControl, | ||
__experimentalFontFamilyControl as FontFamilyControl, | ||
__experimentalLetterSpacingControl as LetterSpacingControl, | ||
LineHeightControl, | ||
} from '@wordpress/block-editor'; |
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.
What is the reasoning behind picking these controls from @wordpress/block-editor
, but picking FontSizePicker
from @wordpress/components
?
In general, for the purpose of this Storybook example, should we use components from @wordpress/block-editor
or from @wordpress/components
?
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.
I just imported the components used in the existing TypographyPanel
for the most part.
I don't think it really matters which things we use here (existing block-editor components or wp-component primitives) at least in this PR, as they are only placeholders right now. We'll be evaluating each piece on a case-by-case basis, and replace when necessary. As a starting point, I'm inclined toward having the "real world" block-editor components as a reference so we don't make assumptions based on static mockups only. (e.g. This has already surfaced a concern with the Letter Spacing mockup, which doesn't take units into account.)
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.
That makes sense to me. I was just curious about why we didn't also pick FontSizePicker
from @wordpress/block-editor
.
As a starting point, I'm inclined toward having the "real world" block-editor components as a reference so we don't make assumptions based on static mockups only.
Makes sense, let's go with your approach!
Adding @aaronrobertshaw here since he's the main developer behind
I believe that's in the works, including researching the best approach to |
Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>
Thanks for the ping. The use of the Other than the exploration into adopting the It's also worth raising here that there is currently an open PR switching the existing Typography panel over to the ToolsPanel. I'm not sure at present whether there is the desire to land that with current controls first or wait until we have all the new components done. Either way, I'm happy to collaborate in whatever way is best. Please let me know if I can help 🙂 |
3bb3d9b
to
e56bbba
Compare
No need to wait. From what I understand, we'll be making incremental updates to the underlying components. @mtias has said that it's fine to have some mismatched styling in the interim 🙂 |
I added an item on the tracking issue to use @ciampo Are we good to go? |
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.
@ciampo Are we good to go?
Yes we are! 🚀
Thank you for creating the storybook examples and for starting to log what needs to be worked on.
Description
Adds an exploratory TypographyPanel story under the ToolsPanel section so it can serve as a living guide/playground for the TypographyPanel-related components work. It uses ToolsPanel and other existing components, so it exposes what’s missing design-wise.
In terms of ToolsPanel, the main gap I'm seeing is the grid/column approach. The
.single-column
class should not be exposed, but whether we're going to provide some kind of grid/column layout methods as a part of ToolsPanelItem, or allow the consumer to use their own wp-componentGrid
s, we'll have to decide. (I'm inclined to choose the latter, as it's more flexible.)How has this been tested?
npm run storybook:dev
Screenshots
Types of changes
Storybook-only, non-breaking
Checklist:
*.native.js
files for terms that need renaming or removal).