-
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
Makes spacing consistent in zoom out vertical toolbar #63994
Conversation
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. |
Size Change: +23 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
Flaky tests detected in a69454f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11156023201
|
Hi @richtabor, Is there something that needs to be done from my side? |
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 the PR 🎉
If we can make some small changes to remove abstractions I think we'll be in a good place code-wise.
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 noticed the changes were previously in the @wordpress/components
package which shouldn't have any awareness of "zoom out".
I therefore moved the CSS to the @wordpress/block-editor
package which is where the state for "zoom out" resides.
However, this change hasn't worked implementation wise so we'll need to look at this again if possible 🙏
The aim is to get consistent spacing between each of the toolbar icons.
|
||
// Make the spacing consistent between controls. | ||
.components-button { | ||
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.
Any reason this shouldn't use $button-size-next-default-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.
height: 40px; | |
height: $button-size-next-default-40px; |
@richtabor Not as far as I know. However, when I checked out this PR the implementation doesn't quite work.
I would look to fix this, but I actually find it really hard to notice the differences/inconsistencies in spacing. My brain plays tricks.
Moreover, sometimes even when the spacing between items is "correct" it still looks visually "off" because of the relative space occupied by the icons in use. I wonder whether we'll need a default spacing and then custom / specific spacing on a case by case basis?
c270065
to
dd9ff72
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.
I think this is OK, for me using the scss variable is the same as using the number itself. I don't think the styling should be elsewhere as it styles stuff in the block editor package. What am I missing @getdave ?
@draganescu This is now all good. I moved the CSS into the correct package in previous commits and @richtabor has confirmed he's happy with the visual appearance (which I was struggling to verify myself). Therefore I'd be happy to merge this. |
Needs a rebase to allow tests to pass |
a69454f
to
8f655fa
Compare
👋 Hello! I would ask you to revisit the approach taken here:
Those are best practices that can go a long way in raising the quality of our code and our UIs; they are something that we hope everyone working on Gutenberg can learn and apply both when authoring and when reviewing code. cc @WordPress/gutenberg-components @WordPress/gutenberg-design |
Ok thanks @ciampo. I'll take ownership of sorting this out as I should definitely have known better. Can I ask is any of the above in public documentation that you would be able to point me towards? |
Thank you, @getdave , I appreciate!
This paragraph specifies that "A component's class name should never be used outside its own folder" and highlights how this is a best practice to ensure encapsulation and reusability. I don't believe the rest is really codified in public docs, I'd say it's more common sense. But there should definitely be an effort from our side to write better docs, best practices, maybe even lint rules. |
I'm thinking more along the lines of https://make.wordpress.org/core/2024/09/12/gutenberg-development-practices-and-common-pitfalls/. One person's "common sense" is often not that clear to others and thus I"m keen we start to surface these "best practices" or "common sense guidelines". I'm not attempting to absolve myself here, but rather noticing that newer contributors may not share the context that you and I (should) have. |
You're absolutely right, I'll start brainstorming a similar post and share it with y'all at a later point |
Follow up here #65858
Feel free to share a draft and I'll happily proof read. |
See #63994 (comment) Co-authored-by: getdave <[email protected]> Co-authored-by: MaggieCabrera <[email protected]> Co-authored-by: ciampo <[email protected]>
* chore: Update block vertical toolbar height in variables and styles * Removed the variable and hardcoded the value. * Avoid changes to components package * use the button width scss variable --------- Co-authored-by: amitraj2203 <[email protected]> Co-authored-by: getdave <[email protected]> Co-authored-by: draganescu <[email protected]> Co-authored-by: richtabor <[email protected]>
See #63994 (comment) Co-authored-by: getdave <[email protected]> Co-authored-by: MaggieCabrera <[email protected]> Co-authored-by: ciampo <[email protected]>
See WordPress/gutenberg#63994 (comment) Co-authored-by: getdave <[email protected]> Co-authored-by: MaggieCabrera <[email protected]> Co-authored-by: ciampo <[email protected]> Source: WordPress/gutenberg@18fdd25
See WordPress/gutenberg#63994 (comment) Co-authored-by: getdave <[email protected]> Co-authored-by: MaggieCabrera <[email protected]> Co-authored-by: ciampo <[email protected]> Source: WordPress/gutenberg@86e278c
See WordPress#63994 (comment) Co-authored-by: getdave <[email protected]> Co-authored-by: MaggieCabrera <[email protected]> Co-authored-by: ciampo <[email protected]>
What?
Fixes: #63807
Why?
See this comment
Testing Instructions
Screenshots or screencast
Co-authored-by: amitraj2203 [email protected]
Co-authored-by: getdave [email protected]
Co-authored-by: draganescu [email protected]
Co-authored-by: richtabor [email protected]