-
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
FontAppearanceControl: use CustomSelectControl V2 legacy adapter #63179
FontAppearanceControl: use CustomSelectControl V2 legacy adapter #63179
Conversation
Size Change: +20 B (0%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
Regarding this point (quoted from the PR description):
I pushed a tentative change to
@WordPress/gutenberg-components what do you think about this proposed change? It tries to mimic as closely as possible the behavior of the legacy V1 custom select control. Once we have an agreement on next steps, I'll apply changes in a separate PR. |
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. |
font-size: 0; | ||
|
||
${ WithHintItemWrapper } ~ &, | ||
[aria-selected='true'] & { |
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.
what do you think about this proposed change?
I guess there are many ways to address this problem, but I think this approach is ok for now as long as we add a code comment. Otherwise it isn't immediately clear what this font-size switching is for.
There's a part of me that want to address it at the JS level and not in CSS, but given that the checkmark might be moved to left eventually, it's probably not worth the effort to rejigger the code now.
Also, no strong opinion but I think I slightly prefer this since it captures how SelectedItemCheck
is some kind of placeholder:
[aria-selected='true'] & { | |
&:not(:empty) { |
(Though, the change may not be necessary as long as the code comment is explaining things)
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's a part of me that want to address it at the JS level and not in CSS, but given that the checkmark might be moved to left eventually, it's probably not worth the effort to rejigger the code now.
I had the same itch, but I figured that seeing how V2 may diverge from V1 and its quirks, we may just end up leaving future V1 implementation independent (at least the styles).
I'll go ahead and implement your suggestions before merging.
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.
Changes extracted in #63229. Once merged, I will rebase and merge this PR too.
faaa552
to
8410e39
Compare
@@ -469,7 +469,6 @@ export default function TypographyPanel( { | |||
hasFontWeights={ hasFontWeights } | |||
fontFamilyFaces={ fontFamilyFaces } | |||
size="__unstable-large" | |||
__nextHasNoMarginBottom |
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.
Removing __nextHasNoMarginBottom
since it's not even a valid prop anymore for CustomSelectControl
. The component doesn't have a bottom margin anyway
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.
Tests well and the code looks good to me 👍
🚀
color: $gray-900; | ||
text-transform: capitalize; | ||
} | ||
[role="option"] { |
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.
Switching from ul > li
to [role="option"]
was necessary because the new version of CustomSelectControl
doesn't use ul
and li
s — and in general it makes these styles more resilient to future changes.
…dPress#63179) * FontAppearanceControl: use CustomSelectControl V2 legacy adapter * Remove unnecessary __nextHasNoMarginBottom and avoid console error --- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org>
…dPress#63179) * FontAppearanceControl: use CustomSelectControl V2 legacy adapter * Remove unnecessary __nextHasNoMarginBottom and avoid console error --- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org>
What?
Part of #55023
Replace the V1
CustomSelectControl
with the V2 legacy adapter in the font appearance controlWhy?
The goal is to ultimately replace the legacy V1 implementation entirely with the V2 legacy adapter. We're performing the migration gradually, and fixing any bugs / gaps as we go.
How?
Testing Instructions
trunk
Note
There are few known differences between trunk and this PR:
Screenshots or screencast
cscv2.font.appearance.control.v1.mp4
cscv2.font.appearance.control.v2.mp4