-
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
Use Badge component in page markers #68103
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: -46 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
Flaky tests detected in 7af1658. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12411888493
|
Maybe this was fixed by #68115. Worth a rebase to check :) Edit: I suppose not since that change targeted _Block_Card. But perhaps the same technique can be used here? |
Thanks! Indeed, the rebase didn't fix it. But I took the same approach. Hopefully the choice of class name is ok. |
Nice, that seems to have solved it. This seems good to go from the design 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.
Thank you for working on it @juanfra 🙌
I think we can simplify a bit further, please see inline comments.
.editor-post-card-panel__title-name { | ||
padding: 2px 0; | ||
} |
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 unnecessary, because the wrapping .editor-post-card-panel__title.editor-post-card-panel__title
already has display: flex; align-items: center
, and it should center the nested title name vertically even without providing top/bottom padding.
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.
@tyxla Thanks for reviewing! Right, in that case is indeed not needed. I kept it for the particular case when the page title is long, and displayed in two lines.
That's when, without the padding, the vertical alignment ends up pushing the page title to the top and the alignment between title and icon is not working (please see the screenshot on the Panel title without 2px padding and long title
column here).
If we're okay with not having that, I can remove it. The only thing is that it won't be in line with what we have for the Block Card.
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.
The proposed truncation is for the Badge, though. What's pushing things to be in two lines is the page title in this case.
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.
Ah, I see what you mean. I think it makes sense to keep the padding then 👍
@@ -109,11 +111,11 @@ export default function PostCardPanel( { | |||
className="editor-post-card-panel__title" | |||
as="h2" | |||
> | |||
{ title } | |||
<span className="editor-post-card-panel__title-name"> |
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 wrapper is unnecessary, see below comment for explanation.
.editor-post-card-panel__description { | ||
color: $gray-700; | ||
} | ||
} | ||
|
||
.editor-post-card-panel__title-badge { |
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.
👏
@@ -1,10 +0,0 @@ | |||
.fields-field__page-title__badge { |
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.
Loving all the cleanup! ❤️
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 👍
Thank you for the reviews 🙌 |
What?
Partial to #68020
Alternative to #68086
Use the new Badge component for the page markers.
Why?
To improve consistency and sustainability.
How?
Using the new component and removing redundant styles.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Screen.Recording.2024-12-18.at.17.00.55.mov