Skip to content
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

Recent Comments block: remove hardcoded color #24410

Merged

Conversation

aristath
Copy link
Member

@aristath aristath commented Aug 6, 2020

This will remove the hardcoded color from .wp-block-latest-comments__comment-date.
If a theme uses a dark background or anything other than white, a hardcoded text-color will not work and themes will be forced to add custom styles and override the defaults.
By removing the custom color definition, the comment-date will use the current text color, therefore avoiding any implications and overrides associated with hardcoded color values.
That selector is already smaller in size, making it lighter in color will only make it harder to read.
If we absolutely need it to have a different color, we could instead use something like opacity:0.9;. This will keep using the currently defined text-color so it will be OK both for light and dark themes.

Also related: #24409 which is a companion to this PR and deals with using relative instead of absolute units for the block.

@ntsekouras ntsekouras added the Needs Design Feedback Needs general design feedback. label Aug 11, 2020
@ntsekouras ntsekouras requested a review from jasmussen August 11, 2020 14:18
@ZebulanStanphill ZebulanStanphill added [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement. CSS Styling Related to editor and front end styles, CSS-specific issues. [Package] Block library /packages/block-library [Block] Latest Comments Affects the Latest Comments Block labels Aug 11, 2020
Copy link
Contributor

@jasmussen jasmussen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Wonderful PR, even if just one line.

The initial reason for adding this color, way back in the day, was probably to give some more utility to the block out of the gate. However the value is dubious and as you note, it interferes even if slightly, with a theme's ability to style.

@jasmussen jasmussen merged commit 2afb5b2 into WordPress:master Aug 12, 2020
@github-actions github-actions bot added this to the Gutenberg 8.8 milestone Aug 12, 2020
@aristath aristath deleted the aristath/latest-comments-no-color branch August 12, 2020 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Latest Comments Affects the Latest Comments Block CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Needs Design Feedback Needs general design feedback. [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants