-
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
Fix: Align tooltip with others element spacing wise #64454
Open
Rishit30G
wants to merge
11
commits into
WordPress:trunk
Choose a base branch
from
Rishit30G:fix/align-tooltip-bar
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7ca74aa
alter styles of move up and move down label
Rishit30G 6762d98
Function to get direction using direction and orientation
Rishit30G 3064043
Add Tooltip direction
Rishit30G 6d5fd4c
remove redundant styles
Rishit30G 20b6b73
Alter gutter based on direction
Rishit30G c3b3004
fix tooltipDirection types
Rishit30G d29cce4
fix block-mover height style
Rishit30G ff1030a
Update tooltipDirection with existing tooltipPosition
Rishit30G 169504b
Update gutter value based on direction
Rishit30G 10aaa2e
revert grid-unit-05 style
Rishit30G c6be2d3
Refactor block-mover button and tooltip gutter value
Rishit30G File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,3 @@ | |
.components-tooltip__shortcut { | ||
margin-left: $grid-unit-10; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Note that there is already a
tooltipPosition
prop onButton
that can you can use to change the tooltip placement (e.g."top"
and"bottom"
).I don't think we will need any changes in the
@wordpress/components
package to land this PR. As for fine-tuning the "bottom" placement so the block mover down tooltip aligns with the other toolbar button tooltips, I think a cleaner strategy would be to fix the metrics of the block mover buttons so their vertical edges are aligned with the other buttons. If you add a visible outline to the buttons, you can see that the block mover buttons are shorter. This is causing the misalignment of the tooltips.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.
Hi @mirka, Agree on this, We just need to adjust this style added here which make this height -
gutenberg/packages/block-editor/src/components/block-mover/style.scss
Line 12 in 46f9fe0
24px
, by removing the$grid-unit-05
, not sure why this added, may be to decrease the space between chevrons,Also, need to adjust the top and bottom padding for
up
anddown
button to10px
, so that it looks what it looked like earlier.@Rishit30G, Could you please adjust this style and check if it helps,
The
move up
, would still not in place, butmove down
would be consistent with different toolbar tooltips.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.
Agreed @mirka's suggestions are the way to go. We should use what we have and keep any specific customization outside of the
Tooltip
component.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 suggestions @mirka, @hbhalodia, @tyxla 🙇
tooltipDirection
and usedtooltipPosition
height: $block-toolbar-height * 0.5 - $grid-unit-05;
toheight: $block-toolbar-height * 0.5;
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.
This style was added when introducing a custom scrollbar to the block toolbar in #57444 (Sorry for not leaving a comment 🙇♂️).
If we remove
$grid-unit-05
, an unnatural shift will occur when the mover button is focused on Windows OS:500cb196af93dc4912fdc5a684188eac.mp4
We tried a lot of different things to fix this problem in #57444, but for now, I think it's better not to remove
$grid-unit-05
.Of course, if the top toolbar is disabled, there's no problem with removing
$grid-unit-05
, but if adjusting the tooltip position becomes complicated, I think it's better to leave$grid-unit-05
.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 info @t-hamano! 🙌🏻
I already made a workaround for this in previous commits, will see if I can incorporate it without breaking
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.
Fixed ✅
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.
Hey @Rishit30G , I agree with @mirka 's suggestions above, especially about
Can we make sure this PR doesn't include changes to
Button
andTooltip
? Thank you 🙏