Open ciampo opened 3 years ago
Has any consideration been given to the use of these components in a dropdown menu context along with the inspector panel?
I have been looking at https://github.com/WordPress/gutenberg/issues/20837, but currently the color/gradient controls seem very coupled to the inspector panels.
Has any consideration been given to the use of these components in a dropdown menu context along with the inspector panel?
I have been looking at #20837, but currently the color/gradient controls seem very coupled to the inspector panels.
@jasmussen and @mtias may be better suited to answer this question
Has any consideration been given to the use of these components in a dropdown menu context along with the inspector panel?
I imagine the primary benefit of having a flyout version of the color swatch picker is that the flyout itself can be invoked either by an Item in the ItemGroup, or a button in the Toolbar. Here's how it could look for the Cover:
Edit: I've updated the above mockup to include a segmented control for gradients, which I previously forgot about. Some of the details could still be massaged, but the puzzle pieces should be in place.
I like your design, @jasmussen, but there's something I'm starting to get worried about with the increased use of segmented controls: if we end up adding more items, we'll probably need to switch to a dropdown since segmented controls won't scale equally well in every language.
Maybe it's just me optimizing prematurely and we won't have more than two or three options in that flyout, but I'd consider exploring an option with a dropdown.
There are definitely cases where the segmented control won't work, good call. I do think that might be a bridge we need to cross when we get there. At the moment, "Linear" and "Radial" are both properties of the gradient control itself, which would make "Image" fit if that ends up being an addition.
I like your design, @jasmussen, but there's something I'm starting to get worried about with the increased use of segmented controls: if we end up adding more items, we'll probably need to switch to a dropdown since segmented controls won't scale equally well in every language.
Maybe it's just me optimizing prematurely and we won't have more than two or three options in that flyout, but I'd consider exploring an option with a dropdown.
I believe a similar pattern is being explored for Typography Tools (#34345), where we switch between a segmented control and a dropdown for the Font sizes (depending on the number of items to display)
Would like to propose a few minor tweaks for 5.9 to make the current color panel more intuitive and if i may... palatable. (While we are waiting for some improvements to land post 5.9.) If we can't get most of these in, I would hesitate to include this. @jasmussen - what do you think?
For reference - the current experience is quite overwhelming.
I really like the color card in Global styles. It's primarily the fact that in the post editor it will nearly always show the transparency, which when duplicated like it is without the ItemGroup collapsing makes it lose much of its intrinsic meaning.
In that vein, I took a stab at Kelly's suggestion above in #36243. It's a quite hacky PR, and if it can be unhackified, it might be a better solution than reverting the card.
One more thing to add to @kellychoffman's notes above — I think one thing that's hurting the readability is that there's not a very clear visual hierarchy between the section headings. Squinting at this image, the all caps palette headings almost appear heavier than the regular title case label:
Setting the all caps labels in gray-800 would help those recede a bit.
Good call, that's another aspect. In the original context in which the card was designed, it's meant to be the entirety of the contents of the panel, meaning the sidebar header is the heading:
Shared a few ideas over on the related PR: https://github.com/WordPress/gutenberg/pull/36243#issuecomment-962057612
Hey @kellychoffman @critterverse @shaunandrews! Since this is a tracking issue, would you mind opening a separate issue specific to discuss the Color Panel changes, and link to it from here?
Thank you!
Added a design issue here: https://github.com/WordPress/gutenberg/issues/36543
Is there a reference anywhere for adding the new color picker component/s to a custom block? I’ve been using PanelColorSettings
until now (which looks like this), but this omits the Standard color set and doesn't respect the settings in theme.json.
Is there a reference anywhere for adding the new color picker component/s to a custom block? I’ve been using
PanelColorSettings
until now (which looks like this), but this omits the Standard color set and doesn't respect the settings in theme.json.
Maybe @aaroncampbell or @jasmussen can help you out here?
Possibly one for consideration here: https://github.com/WordPress/gutenberg/issues/41868. And this one: https://github.com/WordPress/gutenberg/issues/41866
Is there a reference anywhere for adding the new color picker component/s to a custom block? I’ve been using PanelColorSettings until now (which looks like this), but this omits the Standard color set and doesn't respect the settings in theme.json.
Perhaps @jorgefilipecosta?
Is there a reference anywhere for adding the new color picker component/s to a custom block? I’ve been using
PanelColorSettings
until now (which looks like this), but this omits the Standard color set and doesn't respect the settings in theme.json.
PanelColorSettings should automatically retrieve theme.json colors and settings if they are not passed. Using the ColorPalette from the block editor package should also automatically include colors and settings. What issues did you found if the color are not passed?
This is an overview issue to track all of the tasks necessary to refine the color-related components, especially in the context of using it in the updated Global Styles Sidebar.
Context
To visualize this, there are some good mockups in #34574 that illustrate the behavior above. Instead of duplicating all available color palettes for each a single item in a group is shown as a swatch plus a label:
Click an item in the group drills down to a dedicated subpanel showing all available color tools:
Here's an additional mockup that shows how the full flow for collapsible color swatches could work when used in editor inspector panels:
Please note that the precise visuals are subject to change per further work in #34574, so definitely defer to that ticket as the source of truth.
Essentially, multiple color properties are grouped together in an ItemGroup, as swatch+label.
Next steps
Note: This issue should be considered a draft, and will eventually supersede #33820
ColorSwatch
For more context of the conversation leading to
ColorSwatch
& more, see #33820.ColorSwatch
componentisInteractive
prop vs two separate componentsColorIndicator
to useColorSwatch
internallyCircularOptionPicker.Option
to useColorSwatch
internallyColorPicker
Please refer to #34284 for the work related to the updated
ColorPicker
componentHigher-level color components
With the new
ColorSwatch
andColorPicker
components, we're going to be able to look at higher-level color components (currentlyColorPalette
,CircularOptionPicker
...)We will need to reassess the new needs that these components need to fulfil. For example, the custom color and clear/reset features of
ColorPalette
may be assumed by other components (like the newly introducedToolsPanel
). And rather than rendering a palette of color options directly in the sidebar, we’ll be moving toward usingItemGroup
to group color attributes. In Global Styles, clicking an Item will drill down to another sheet displaying the available color options and related components. In block sidebars, this action will likely result in a popover with similar controls.ColorPalette
Gradient Picker & related