-
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 text alignment in the Site Editor sidebar #48959
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
1 change: 1 addition & 0 deletions
1
packages/edit-site/src/components/sidebar-navigation-item/style.scss
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 |
---|---|---|
|
@@ -26,3 +26,7 @@ | |
white-space: nowrap; | ||
overflow: hidden; | ||
} | ||
|
||
.edit-site-site-hub__site-title { | ||
margin-left: $grid-unit-05; | ||
} |
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.
Ack, this one's kinda ugly. It looks like this is to enable the focus style. I think that actually puts our metrics off in other places too, like the 40px item-height. If it's a nightmare to refactor the focus style to use a box-shadow + transparent outline (for high contrast mode) like our buttons do, I'm happy to approve this one. But that seems like a refactor to do eventually, what do you think?
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.
Item
calls aButton
. So I don't really understand why this transparent border is being added here, I'd expect the focus style to be inehrent to theButton
component.I'll see if I can move it to a pseudo element, but that feels a bit like replacing one hack with another xD
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.
Seems the border wasn't actually required, so I removed it. A small margin is still required for the alignment though.
border.mp4
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.
Oh nice, you solved it, let me review in a second. This one:
It should be possible to use box-shadow for the focus style, which wouldn't affect the footprint whereas border does.
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 removed the border.
The focus style now comes from
.css-1xahv0o-View-unstyledButton-medium-item-spacedAround:focus
which seems to be connected to the experimentalItemGroup
/Item
components.I agree it would be nice to update that to use
box-shadow
rather than the currentborder
implementation. But since that's at the component level it should probably be handled in a dedicated PR?