-
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
Fix <Text>
component text color value to correct color value for Link UI preview description text
#35851
Conversation
Size Change: +309 B (0%) Total Size: 1.07 MB
ℹ️ View Unchanged
|
Very fast work, thank you! And it solves the problem: This PR specifies the right color. But it also overrides an existing black color, which I'd challenge to not be useful in the first place: As it turns out, we do need to provide a baseline color for the component, as even if we were to remove that black color, the text would inherit all the way back to wp-admin styles. But I was thinking something along the lines of adding the color to My line of thinking is that the text component should be agnostic about what color it offers, and inherit that of its surroundings. That may be incorrect? In any case, the black color appears to come from https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/text/styles.js#L12. A different fix might be to assign the gray-900 variable there? Thanks again! |
Yeh I guess that could work? I'm going to ping someone working on components to try and get some insight into the decisions there. Are you saying |
Marco is AFK these days, but perhaps @mirka can provide input?
Yes, for the current visual setup, we shouldn't actually use true black for anything but drop shadows and edgecases. |
👍🏻 In the original context in G2 the Text component was assigned |
e2945c7
to
a2fcdbe
Compare
<Text>
component text color value to correct color value for Link UI preview description text
@jasmussen @griffbrad I've updated the Is this good to 🚢 ? |
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.
"darkGray.primary" suggests to me we need a refreshed naming scheme, ideally one that can either inspire/upgrade the existing SCSS one, or just plain adopt it:
$black: #000; // Use only when you truly need pure black. For UI, use $gray-900.
$gray-900: #1e1e1e;
$gray-800: #2f2f2f;
$gray-700: #757575; // Meets 4.6:1 text contrast against white.
$gray-600: #949494; // Meets 3:1 UI or large text contrast against white.
$gray-400: #ccc;
$gray-300: #ddd; // Used for most borders.
$gray-200: #e0e0e0; // Used sparingly for light borders.
$gray-100: #f0f0f0; // Used for light gray backgrounds.
$white: #fff;
But that's a separate issue.
Another solution is color: inherit;
— I'm actualy not sure why we need to bake colors into the Text component at all. What if it's used in dark mode?
I'll give this one a green check, because the component currently ships with the wrong color, and this rectifies that. But I would appreciate if @griffbrad could also just sanity check this one, especially whether we can move straight on to inherit
or not.
I’m hesitant to jump straight to |
@griffbrad We can always merge this fix now and look to refactor to |
Yeah. I think it’s totally fine to proceed with this fix and then revisit |
Description
In #35833 (comment) @jasmussen noticed we are using the wrong text color in the description text of the Link UI preview.
This was because the
<Text>
component uses black and not darkGray from the available color values.This PR corrects the underlying Text component from
#000
to$gray-900
. This has the knock on effect of fixing the LinkControl preview.How has this been tested?
$gray-900
(#1e1e1e
).<Text>
component (as opposed to any styles applied directly to<LinkControl>
).Screenshots
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).