-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Spacing presets: Modify the styling of the input controls when in unlinked mode in order to better differentiate sides #44141
Conversation
Size Change: +453 B (0%) Total Size: 1.27 MB
ℹ️ View Unchanged
|
Nice, a big improvement, thanks for working on this: I don't think we should do the indent, though, as it breaks the vertical grid we're aiming for. Can we update the labels to be the new all-caps style as well? I tried myself replacing the |
@jasmussen thanks for reviewing, will look at implementing the suggested changes tomorrow - can you point me to a control that has the all caps style already? |
@jasmussen I have made the suggested changes. I just copied the font control and used |
Nice, thank you. I'd love a quick review by @jameskoster as he has the metrics on mind. The icon looks bottom-aligned compared to the label, can it be centered vertically with it? |
Better, thank you! But there are a few bolts to tighten. The range doesn't seem to occupy the full container width – there's a gap between the grey track and the right-hand edge. Range height is 36px, can we make it 40px, with a 16px bottom margin? When you switch to a custom value, a gap appears on the left/right. The label container has a 30px min-height. It should instead wrap the label (and consequently have an inherent height of 16px), then have a bottom margin of 8px to create the correct space between label + range. The 'custom' icon for block spacing isn't aligned with the others. |
@jameskoster I think I have covered all those things off. There seems like quite a bit of white space now, but maybe that is how you want, or maybe I have missed something: |
Thanks Glen. The label is still a bit too tall: The spacing is based on a scheme @jasmussen has shared before: It looks a bit large here because the range visually occupies a relatively small vertical space. I don't think it's a deal-breaker, but I'll let Joen decide :) |
@jasmussen How are you feeling about this? Visually it's better, but the spacing doesn't align to the grid correctly. I suspect it's tricky to get right due to the @glendaviesnz I don't know if it's helpful but here's a Figma with everything spaced according to the grid. |
Thanks @jameskoster, yeh the grid layout makes it a bit trickier, but I should be able to get it much closer with this extra detail you have provided - public holiday here Monday though, but should be able to sort first thing Tuesday |
@jameskoster I had to use some margins to get the spacing rather than the grid gaps as it isn't possible to specify different gaps on a per row basis (as far as I am aware). It it pretty close to the Figma design now - the following is the current layout on this PR pasted over the figma one: The range is about 0.5 pixels out, but this is the closest I could get 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.
Thanks for your perseverance with this one Glen, it's nicely aligned to the grid now :)
I left a few comments, perhaps we can use variables for some of the values?
The last thing we need to decide on from the design perspective is whether to pursue the 40px control height for the ranges here. It does create a large gap. But if we reduce the height it will likely require tweaking other spacing values. What do you think @jasmussen ?
packages/block-editor/src/components/spacing-sizes-control/style.scss
Outdated
Show resolved
Hide resolved
justify-content: left; | ||
height: 16px; |
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.
$grid-unit-20
.
packages/block-editor/src/components/spacing-sizes-control/style.scss
Outdated
Show resolved
Hide resolved
packages/block-editor/src/components/spacing-sizes-control/style.scss
Outdated
Show resolved
Hide resolved
packages/block-editor/src/components/spacing-sizes-control/style.scss
Outdated
Show resolved
Hide resolved
@@ -82,8 +95,8 @@ | |||
|
|||
.components-spacing-sizes-control__range-control { | |||
grid-column: span 3; | |||
padding-right: $grid-unit-10; | |||
height: 30px; | |||
height: 40px; |
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.
Should we use $grid-unit-50
here? Unsure how the other control updates have specified their height.
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.
At the moment color indicator is the only component using that var, and it does a *0.5
on it to get 20px
.
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.
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.
Let's not use $grid-unit-50
— it's not something that we've been using much in @wordpress/components
(color indicator is a legacy component and in this case a bit of an exception)
…er to better differentiate sides
a7599fb
to
39bc327
Compare
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.
Had a quick look at this PR and this file, noticed a few things:
- We should use the
__nextHasNoMarginBottom
prop onRangeControl
— this way theRangeControl
component doesn't add any bottom margin by default, and it makes it easier to add spacing around it - The labelling situation of composite range controls + unit controls looks a bit messy, we should probably start allocating resources for working on Components: label multiple / composed inputs correctly #42630 (comment)
- It looks like we're applying a few style overrides to
RangeControl
(most importantly, setting a40px
height) — these changes/necessities ideally should be discussed in a separate issue and applied directly toRangeControl
instead of as a style override (cc'ing @mirka who has been working on updating control component sizes in the past months)
@@ -82,8 +95,8 @@ | |||
|
|||
.components-spacing-sizes-control__range-control { | |||
grid-column: span 3; | |||
padding-right: $grid-unit-10; | |||
height: 30px; | |||
height: 40px; |
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.
Let's not use $grid-unit-50
— it's not something that we've been using much in @wordpress/components
(color indicator is a legacy component and in this case a bit of an exception)
I have done this and adjusted things to maintain the same layout as before. The Range control adjustments were only ever temporary while @aaronrobertshaw was working on the new version of the control. I think we should merge this in as is if we want to get it into 6.1 and follow up on other things in separate issues as suggested |
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.
Or does this mean that my above comment isn't valid? |
Sorry @ramon the before and after had not kept up with the ongoing changes - have updated to which matches the Figma layout requested: |
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
Thanks for the update @glendaviesnz !
Sure, my comments weren't mean to be a blocker — but still, it would be good to discuss any tweaks to Same goes for
As we build more complex composite controls, we should really have a solid way of labelling such controls consistently across the editor |
…inked mode in order to better differentiate sides (#44141)
Cherry-picked for the 6.1 release in #44656 |
…inked mode in order to better differentiate sides (#44141)
Package updates for bug and regression fixes: * @wordpress/annotations: 2.17.3 * @wordpress/block-directory: 3.15.4 * @wordpress/block-editor: 10.0.4 * @wordpress/block-library: 7.14.4 * @wordpress/blocks: 11.16.4 * @wordpress/components: 21.0.4 * @wordpress/core-data: 5.0.4 * @wordpress/customize-widgets: 3.14.4 * @wordpress/data: 7.1.3 * @wordpress/data-controls: 2.17.3 * @wordpress/edit-post: 6.14.4 * @wordpress/edit-site: 4.14.5 * @wordpress/edit-widgets: 4.14.4 * @wordpress/editor: 12.16.4 * @wordpress/format-library: 3.15.4 * @wordpress/interface: 4.16.3 * @wordpress/keyboard-shortcuts: 3.15.3 * @wordpress/list-reusable-blocks: 3.15.4 * @wordpress/notices: 3.17.3 * @wordpress/nux: 5.15.4 * @wordpress/preferences: 2.9.4 * @wordpress/reusable-blocks: 3.15.4 * @wordpress/rich-text: 5.15.3 * @wordpress/server-side-render: 3.15.4 * @wordpress/style-engine: 1.0.3 * @wordpress/viewport: 4.15.3 * @wordpress/widgets: 2.15.4 References: * [WordPress/gutenberg#44634 Gutenberg PR 44634] – Quote block: stop slash inserter popup showing in citation * [WordPress/gutenberg#44630 Gutenberg PR 44630] – Query Loop: Fix condition for displaying 'parents' control * [WordPress/gutenberg#44554 Gutenberg PR 44554] – Hide the Classic block in the Site Editor * [WordPress/gutenberg#44594 Gutenberg PR 44594] – Fix navigation block console error * [WordPress/gutenberg#44555 Gutenberg PR 44555] – Theme export: Fix broken spacingScale export * [WordPress/gutenberg#44580 Gutenberg PR 44580] – Code Block: Add box-sizing to fix inconsistent layout * [WordPress/gutenberg#44556 Gutenberg PR 44556] – Remove border from Global Styles previews * [WordPress/gutenberg#44141 Gutenberg PR 44141] – Spacing presets: Modify the styling of the input controls when in unlinked mode in order to better differentiate sides * [WordPress/gutenberg#44453 Gutenberg PR 44453] – Preserve the generic signature of getEntityRecord and getEntityRecords through currying * [WordPress/gutenberg#44504 Gutenberg PR 44504] – Theme.json: fix some outline properties doesn't work properly on the editor * [WordPress/gutenberg#44516 Gutenberg PR 44516] – Add style engine to editor tsconfig references * [WordPress/gutenberg#44523 Gutenberg PR 44523] – Query Loop Block: Rename Query Loop variations allowControls to allowedControls * [WordPress/gutenberg#44520 Gutenberg PR 44520] – Post Featured Image: Fix application of default border style in editor * [WordPress/gutenberg#44286 Gutenberg PR 44286] – Post Featured Image: Fix borders after addition of overlay feature * [WordPress/gutenberg#44482 Gutenberg PR 44482] – Template Editor: Fix crashes due to undefined variables * [WordPress/gutenberg#44480 Gutenberg PR 44480] – Template Parts: Prevent adding block in post editor or inside post template or content blocks * [WordPress/gutenberg#44425 Gutenberg PR 44425] – Fix rotated image crop area aspect ratio * [WordPress/gutenberg#44485 Gutenberg PR 44485] – Fix padding/margin visualizer accuracy * [WordPress/gutenberg#44569 Gutenberg PR 44569] – Theme.json: Fix some shadow properties that do not work properly in the site editor * [WordPress/gutenberg#44575 Gutenberg PR 44575] – ToggleGroupControl: Fix unselected icon color * [WordPress/gutenberg#44526 Gutenberg PR 44526] – TokenInput Field: Try alternative approach to fix screen reader focus issue * [WordPress/gutenberg#44506 Gutenberg PR 44506] – Edit Post: Optimize legacy post content layout * [WordPress/gutenberg#44258 Gutenberg PR 44258] – Add layout styles from Post Content block to post editor Follow-up to [54257] and [54335]. Props czapla, isabel_brison, wildworks, bernhard-reiter, hellofromTonya. See #56467. git-svn-id: https://develop.svn.wordpress.org/trunk@54383 602fd350-edb4-49c9-b593-d223f7449a82
Package updates for bug and regression fixes: * @wordpress/annotations: 2.17.3 * @wordpress/block-directory: 3.15.4 * @wordpress/block-editor: 10.0.4 * @wordpress/block-library: 7.14.4 * @wordpress/blocks: 11.16.4 * @wordpress/components: 21.0.4 * @wordpress/core-data: 5.0.4 * @wordpress/customize-widgets: 3.14.4 * @wordpress/data: 7.1.3 * @wordpress/data-controls: 2.17.3 * @wordpress/edit-post: 6.14.4 * @wordpress/edit-site: 4.14.5 * @wordpress/edit-widgets: 4.14.4 * @wordpress/editor: 12.16.4 * @wordpress/format-library: 3.15.4 * @wordpress/interface: 4.16.3 * @wordpress/keyboard-shortcuts: 3.15.3 * @wordpress/list-reusable-blocks: 3.15.4 * @wordpress/notices: 3.17.3 * @wordpress/nux: 5.15.4 * @wordpress/preferences: 2.9.4 * @wordpress/reusable-blocks: 3.15.4 * @wordpress/rich-text: 5.15.3 * @wordpress/server-side-render: 3.15.4 * @wordpress/style-engine: 1.0.3 * @wordpress/viewport: 4.15.3 * @wordpress/widgets: 2.15.4 References: * [WordPress/gutenberg#44634 Gutenberg PR 44634] – Quote block: stop slash inserter popup showing in citation * [WordPress/gutenberg#44630 Gutenberg PR 44630] – Query Loop: Fix condition for displaying 'parents' control * [WordPress/gutenberg#44554 Gutenberg PR 44554] – Hide the Classic block in the Site Editor * [WordPress/gutenberg#44594 Gutenberg PR 44594] – Fix navigation block console error * [WordPress/gutenberg#44555 Gutenberg PR 44555] – Theme export: Fix broken spacingScale export * [WordPress/gutenberg#44580 Gutenberg PR 44580] – Code Block: Add box-sizing to fix inconsistent layout * [WordPress/gutenberg#44556 Gutenberg PR 44556] – Remove border from Global Styles previews * [WordPress/gutenberg#44141 Gutenberg PR 44141] – Spacing presets: Modify the styling of the input controls when in unlinked mode in order to better differentiate sides * [WordPress/gutenberg#44453 Gutenberg PR 44453] – Preserve the generic signature of getEntityRecord and getEntityRecords through currying * [WordPress/gutenberg#44504 Gutenberg PR 44504] – Theme.json: fix some outline properties doesn't work properly on the editor * [WordPress/gutenberg#44516 Gutenberg PR 44516] – Add style engine to editor tsconfig references * [WordPress/gutenberg#44523 Gutenberg PR 44523] – Query Loop Block: Rename Query Loop variations allowControls to allowedControls * [WordPress/gutenberg#44520 Gutenberg PR 44520] – Post Featured Image: Fix application of default border style in editor * [WordPress/gutenberg#44286 Gutenberg PR 44286] – Post Featured Image: Fix borders after addition of overlay feature * [WordPress/gutenberg#44482 Gutenberg PR 44482] – Template Editor: Fix crashes due to undefined variables * [WordPress/gutenberg#44480 Gutenberg PR 44480] – Template Parts: Prevent adding block in post editor or inside post template or content blocks * [WordPress/gutenberg#44425 Gutenberg PR 44425] – Fix rotated image crop area aspect ratio * [WordPress/gutenberg#44485 Gutenberg PR 44485] – Fix padding/margin visualizer accuracy * [WordPress/gutenberg#44569 Gutenberg PR 44569] – Theme.json: Fix some shadow properties that do not work properly in the site editor * [WordPress/gutenberg#44575 Gutenberg PR 44575] – ToggleGroupControl: Fix unselected icon color * [WordPress/gutenberg#44526 Gutenberg PR 44526] – TokenInput Field: Try alternative approach to fix screen reader focus issue * [WordPress/gutenberg#44506 Gutenberg PR 44506] – Edit Post: Optimize legacy post content layout * [WordPress/gutenberg#44258 Gutenberg PR 44258] – Add layout styles from Post Content block to post editor Follow-up to [54257] and [54335]. Props czapla, isabel_brison, wildworks, bernhard-reiter, hellofromTonya. See #56467. Built from https://develop.svn.wordpress.org/trunk@54383 git-svn-id: http://core.svn.wordpress.org/trunk@53942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Package updates for bug and regression fixes: * @wordpress/annotations: 2.17.3 * @wordpress/block-directory: 3.15.4 * @wordpress/block-editor: 10.0.4 * @wordpress/block-library: 7.14.4 * @wordpress/blocks: 11.16.4 * @wordpress/components: 21.0.4 * @wordpress/core-data: 5.0.4 * @wordpress/customize-widgets: 3.14.4 * @wordpress/data: 7.1.3 * @wordpress/data-controls: 2.17.3 * @wordpress/edit-post: 6.14.4 * @wordpress/edit-site: 4.14.5 * @wordpress/edit-widgets: 4.14.4 * @wordpress/editor: 12.16.4 * @wordpress/format-library: 3.15.4 * @wordpress/interface: 4.16.3 * @wordpress/keyboard-shortcuts: 3.15.3 * @wordpress/list-reusable-blocks: 3.15.4 * @wordpress/notices: 3.17.3 * @wordpress/nux: 5.15.4 * @wordpress/preferences: 2.9.4 * @wordpress/reusable-blocks: 3.15.4 * @wordpress/rich-text: 5.15.3 * @wordpress/server-side-render: 3.15.4 * @wordpress/style-engine: 1.0.3 * @wordpress/viewport: 4.15.3 * @wordpress/widgets: 2.15.4 References: * [WordPress/gutenberg#44634 Gutenberg PR 44634] – Quote block: stop slash inserter popup showing in citation * [WordPress/gutenberg#44630 Gutenberg PR 44630] – Query Loop: Fix condition for displaying 'parents' control * [WordPress/gutenberg#44554 Gutenberg PR 44554] – Hide the Classic block in the Site Editor * [WordPress/gutenberg#44594 Gutenberg PR 44594] – Fix navigation block console error * [WordPress/gutenberg#44555 Gutenberg PR 44555] – Theme export: Fix broken spacingScale export * [WordPress/gutenberg#44580 Gutenberg PR 44580] – Code Block: Add box-sizing to fix inconsistent layout * [WordPress/gutenberg#44556 Gutenberg PR 44556] – Remove border from Global Styles previews * [WordPress/gutenberg#44141 Gutenberg PR 44141] – Spacing presets: Modify the styling of the input controls when in unlinked mode in order to better differentiate sides * [WordPress/gutenberg#44453 Gutenberg PR 44453] – Preserve the generic signature of getEntityRecord and getEntityRecords through currying * [WordPress/gutenberg#44504 Gutenberg PR 44504] – Theme.json: fix some outline properties doesn't work properly on the editor * [WordPress/gutenberg#44516 Gutenberg PR 44516] – Add style engine to editor tsconfig references * [WordPress/gutenberg#44523 Gutenberg PR 44523] – Query Loop Block: Rename Query Loop variations allowControls to allowedControls * [WordPress/gutenberg#44520 Gutenberg PR 44520] – Post Featured Image: Fix application of default border style in editor * [WordPress/gutenberg#44286 Gutenberg PR 44286] – Post Featured Image: Fix borders after addition of overlay feature * [WordPress/gutenberg#44482 Gutenberg PR 44482] – Template Editor: Fix crashes due to undefined variables * [WordPress/gutenberg#44480 Gutenberg PR 44480] – Template Parts: Prevent adding block in post editor or inside post template or content blocks * [WordPress/gutenberg#44425 Gutenberg PR 44425] – Fix rotated image crop area aspect ratio * [WordPress/gutenberg#44485 Gutenberg PR 44485] – Fix padding/margin visualizer accuracy * [WordPress/gutenberg#44569 Gutenberg PR 44569] – Theme.json: Fix some shadow properties that do not work properly in the site editor * [WordPress/gutenberg#44575 Gutenberg PR 44575] – ToggleGroupControl: Fix unselected icon color * [WordPress/gutenberg#44526 Gutenberg PR 44526] – TokenInput Field: Try alternative approach to fix screen reader focus issue * [WordPress/gutenberg#44506 Gutenberg PR 44506] – Edit Post: Optimize legacy post content layout * [WordPress/gutenberg#44258 Gutenberg PR 44258] – Add layout styles from Post Content block to post editor Follow-up to [54257] and [54335]. Props czapla, isabel_brison, wildworks, bernhard-reiter, hellofromTonya. See #56467. Built from https://develop.svn.wordpress.org/trunk@54383 git-svn-id: https://core.svn.wordpress.org/trunk@53942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Package updates for bug and regression fixes: * @wordpress/annotations: 2.17.3 * @wordpress/block-directory: 3.15.4 * @wordpress/block-editor: 10.0.4 * @wordpress/block-library: 7.14.4 * @wordpress/blocks: 11.16.4 * @wordpress/components: 21.0.4 * @wordpress/core-data: 5.0.4 * @wordpress/customize-widgets: 3.14.4 * @wordpress/data: 7.1.3 * @wordpress/data-controls: 2.17.3 * @wordpress/edit-post: 6.14.4 * @wordpress/edit-site: 4.14.5 * @wordpress/edit-widgets: 4.14.4 * @wordpress/editor: 12.16.4 * @wordpress/format-library: 3.15.4 * @wordpress/interface: 4.16.3 * @wordpress/keyboard-shortcuts: 3.15.3 * @wordpress/list-reusable-blocks: 3.15.4 * @wordpress/notices: 3.17.3 * @wordpress/nux: 5.15.4 * @wordpress/preferences: 2.9.4 * @wordpress/reusable-blocks: 3.15.4 * @wordpress/rich-text: 5.15.3 * @wordpress/server-side-render: 3.15.4 * @wordpress/style-engine: 1.0.3 * @wordpress/viewport: 4.15.3 * @wordpress/widgets: 2.15.4 References: * [WordPress/gutenberg#44634 Gutenberg PR 44634] – Quote block: stop slash inserter popup showing in citation * [WordPress/gutenberg#44630 Gutenberg PR 44630] – Query Loop: Fix condition for displaying 'parents' control * [WordPress/gutenberg#44554 Gutenberg PR 44554] – Hide the Classic block in the Site Editor * [WordPress/gutenberg#44594 Gutenberg PR 44594] – Fix navigation block console error * [WordPress/gutenberg#44555 Gutenberg PR 44555] – Theme export: Fix broken spacingScale export * [WordPress/gutenberg#44580 Gutenberg PR 44580] – Code Block: Add box-sizing to fix inconsistent layout * [WordPress/gutenberg#44556 Gutenberg PR 44556] – Remove border from Global Styles previews * [WordPress/gutenberg#44141 Gutenberg PR 44141] – Spacing presets: Modify the styling of the input controls when in unlinked mode in order to better differentiate sides * [WordPress/gutenberg#44453 Gutenberg PR 44453] – Preserve the generic signature of getEntityRecord and getEntityRecords through currying * [WordPress/gutenberg#44504 Gutenberg PR 44504] – Theme.json: fix some outline properties doesn't work properly on the editor * [WordPress/gutenberg#44516 Gutenberg PR 44516] – Add style engine to editor tsconfig references * [WordPress/gutenberg#44523 Gutenberg PR 44523] – Query Loop Block: Rename Query Loop variations allowControls to allowedControls * [WordPress/gutenberg#44520 Gutenberg PR 44520] – Post Featured Image: Fix application of default border style in editor * [WordPress/gutenberg#44286 Gutenberg PR 44286] – Post Featured Image: Fix borders after addition of overlay feature * [WordPress/gutenberg#44482 Gutenberg PR 44482] – Template Editor: Fix crashes due to undefined variables * [WordPress/gutenberg#44480 Gutenberg PR 44480] – Template Parts: Prevent adding block in post editor or inside post template or content blocks * [WordPress/gutenberg#44425 Gutenberg PR 44425] – Fix rotated image crop area aspect ratio * [WordPress/gutenberg#44485 Gutenberg PR 44485] – Fix padding/margin visualizer accuracy * [WordPress/gutenberg#44569 Gutenberg PR 44569] – Theme.json: Fix some shadow properties that do not work properly in the site editor * [WordPress/gutenberg#44575 Gutenberg PR 44575] – ToggleGroupControl: Fix unselected icon color * [WordPress/gutenberg#44526 Gutenberg PR 44526] – TokenInput Field: Try alternative approach to fix screen reader focus issue * [WordPress/gutenberg#44506 Gutenberg PR 44506] – Edit Post: Optimize legacy post content layout * [WordPress/gutenberg#44258 Gutenberg PR 44258] – Add layout styles from Post Content block to post editor Follow-up to [54257] and [54335]. Props czapla, isabel_brison, wildworks, bernhard-reiter, hellofromTonya. See #56467. git-svn-id: https://develop.svn.wordpress.org/trunk@54383 602fd350-edb4-49c9-b593-d223f7449a82
What?
Modifies CSS on spacing presets control to better differentiate which side a control relates to. Also adds a slight indent to better indicate which dimension setting they relate to
Why?
Currently the control is equidistant from the above and below labels so hard to tell which one it relates to.
Fixes: #44121
How?
Adds some additional margins and padding
Testing Instructions
Screenshots or screencast
Before:
After: