-
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 font variants count color contrast ratio and l10n. #58117
Conversation
Size Change: +31 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
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.
Both changes make sense to me.
I found another place where a similar fix might be needed in the Google Fonts tab of the modal dialog. How about addressing this part with this PR?
gutenberg/packages/edit-site/src/components/global-styles/font-library-modal/font-card.js
Lines 59 to 64 in 8dbf156
<Text className="font-library-modal__font-card__count"> | |
{ variantsText || | |
variantsCount + | |
' ' + | |
_n( 'variant', 'variants', variantsCount ) } | |
</Text> |
By the way, this text has a hardcoded #6e6e6e
color, so I think we can replace it with $gray-700;
.
gutenberg/packages/edit-site/src/components/global-styles/font-library-modal/style.scss
Lines 62 to 64 in 8dbf156
.font-library-modal__font-card__count { | |
color: #6e6e6e; | |
} |
@t-hamano thanks for your review. From an accessibility perspective, that is okay. Rather, the problem is that it's not a color included in the default color palette. I'd argue that also the border width and other values should preferably use variables, where appplicable and desirable. Overall, I think all the styesheets of the Fonts Library UI should be reviewed as they appear to not follow the Gutenberg best practices. However, that's a broader issue that it's outside of the scope of this PR. @WordPress/gutenberg-design @matiasbenedetto is there any reason why these stylesheets use colors that are not from the default color palette? Hardcoding 'magic' values across the codebase doesn't seem to be the best way to maintain design consistency to me. |
I see, in that case, I think there is no need to change the color in this PR.
On this point, I completely agree. I'm considering working on replacing all hard-coded color codes and margin/padding values in the stylesheet with CSS variables. As @afercia has reported various issues, accessibility also needs to be re-tested as a whole. |
I completely agree, at the point I'm not sure I would consider the current stylesheets of the fonts librady / modal as 'ready to be merged' in core. I'n the meantime, since the first review was okay, can I have a quick approval of this PR please? 🙂 |
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 👍There are probably two follow-up issues that can be tackled immediately:
- Update variation text in the Google Fonts tab of modal dialogs to align with localization best practices
- Replace all hard-coded color codes and margin/padding values in the stylesheet with CSS variables (I'll be happy to do it)
Nope, thanks for improving it 👍 |
follow-ups:
@t-hamano thanks, I can create the issue for the l10n best practices. |
@getdave @youknowriad as Editor Tech Leads for the 6.5 release and @WordPress/gutenberg-design I'd appreciate your feedback on whether using colors from the color palette is a requirement to consider any code 'ready to be merged'. When you have a chance ❤️ Thanks. |
Sure! I'll be working on it soon so we can ship it to WP6.5. |
Obviously, it's recommended to use the variables for CSS and avoid inline styles like. There are a lot of guidelines for developers working on Gutenberg and I don't believe it's the role of the release leads to go into each PR and check that the guidelines have been followed. For me mistakes happen and it's our collective responsibility to ensure they are followed. We should always assume good intent as well, mistakes happen. |
@youknowriad sure, my intent isn't blaming anyone. I'm more interested in clarifying the process and make sure we all are on the same plan. But I do realize GitHub isn't the best place to discuss this. |
Firstly, thank you for this PR. It's a good example of clean up if/when things do slip through the net. Thank you for following up. I would say that as part of a review process, reviewers should look at whether the PR is using standardised variables for CSS values wherever possible. As you will appreciate, it cannot be a hard rule as there will inevitably be exceptions. I agree with Riad that this guidance applies outside of any particular release cycle. |
This has been fixed in #58237. |
Fixes #58110
What?
_n()
function doesn't follow the WordPress localization best practices.Why?
How?
$gray-700
color, which is the lightest gray that can be used on a white background.sprintf
and a placeholder instead of concatenation.Testing Instructions
#757575
.Screenshot before and after:
Testing Instructions for Keyboard
Screenshots or screencast