Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

Tweak variations to remove explicit color references #619

Merged
merged 17 commits into from
Nov 4, 2024
Merged

Conversation

richtabor
Copy link
Member

@richtabor richtabor commented Oct 22, 2024

Description

Closes #620.

Using currentColor allows for colors to be manipulated manually within the Inspector. Otherwise users are required to modify text and link colors, which feels broken as the text and link colors are the same value to start.

Testing Instructions

Test each color and full style variation across each section style.

@richtabor richtabor added the [Type] Bug An existing feature does not function as intended. label Oct 22, 2024
Copy link

github-actions bot commented Oct 22, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: richtabor <[email protected]>
Co-authored-by: juanfra <[email protected]>
Co-authored-by: carolinan <[email protected]>
Co-authored-by: beafialho <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link

Preview changes

You can preview these changes by following the link below:

I will update this comment with the latest preview links as you push more changes to this PR.

Note

The preview sites are created using WordPress Playground. You can add content, edit settings, and test the themes as you would on a real site, but please note that changes are not saved between sessions.

@carolinan
Copy link
Contributor

Please show that all the color contrasts have been tested.

@richtabor
Copy link
Member Author

Please show that all the color contrasts have been tested.

I asked @beafialho to review, thanks.

@richtabor richtabor requested a review from beafialho October 22, 2024 15:24
@beafialho
Copy link
Contributor

I noticed a few places where links seem to have specific settings and aren't contrasting:

  • Noon: Site Title, Title (Post title), Comments Title, Comment Author, Comment Date, Comment Reply Link, Comment Edit Link and Post Date
  • Midnight, Afternoon, Evening, Twilight: Comment Author, Comment Date, Comment Reply Link, Comment Edit Link and Post Date
  • Dusk, Sunrise, Morning: Comment Author, Comment Date and Post Date

Copy link
Member

@juanfra juanfra left a comment

Choose a reason for hiding this comment

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

Thanks for working on this, Rich! It's looking good.

I've been through the different variations, and here are my findings:

Evening

  • Style 3 - link - Very low contrast (3.24:1)
  • Style 4 - link - Very low contrast (1.07:1)
  • Style 5 - link - Very low contrast (1.42:1)
Before After
evening-before evening-after

Noon

  • Style 4 - Headings - Very low contrast (1:1)
  • Style 5 - Headings - Very low contrast (1:1)
Before After
noon-before noon-after

@juanfra
Copy link
Member

juanfra commented Oct 25, 2024

@richtabor @beafialho I've pushed a commit with changes to fix the parity that we had since this PR, and that should also be fixing the contrast issues I've found.

Rich, feel free to revert if you find any issues. Bea, if you can please give this another go and see if everything looks good on your end.

Thanks 🙌

@beafialho
Copy link
Contributor

Thank you!

I only noticed issues in Noon Section Style 4 (the one with a black background). I believe it must be because Noon has the Headings and Post Titles color defined as #191919. They should indeed be that color, do you think there's a way to keep that color but make it work on this section style? If not, we can adjust accordingly but just to try to stick with the design intention.

noon-contrast-issues.mp4

@juanfra
Copy link
Member

juanfra commented Oct 29, 2024

Thanks @beafialho - I just pushed a change that should fix that.

@beafialho
Copy link
Contributor

Thank you @juanfra, the issues I mentioned in Noon are solved now!

@beafialho
Copy link
Contributor

Can we also make sure the Quote block's colors are looking/working ideally? For more context.

@juanfra
Copy link
Member

juanfra commented Oct 30, 2024

@beafialho I just pushed a change that should fix the quote block issue for all sections in all variations.

Screen.Recording.2024-10-30.at.15.21.34.mov

@beafialho
Copy link
Contributor

Thank you for your patience on this one @juanfra. This one is a tricky one to test because you need to have all the blocks listed out on the same page to get the view. I have noticed on my site that Post Date is still using a fixed color and Pullquote seems too as well. 🫠

Captura de ecrã 2024-10-30, às 14 42 02
Captura de ecrã 2024-10-30, às 14 46 11

I'm not sure about the Code block, but it seems to have a fixed color as well:

code.mp4

Apologies for the back and forth but hopefully after these are addressed this is ready to merge.

@juanfra
Copy link
Member

juanfra commented Oct 30, 2024

@beafialho I pushed a fix for the pullquote in the different section styles.

Could you please clarify the expected behavior for the code and post-date blocks? Where are you taking those screencasts from?

@beafialho
Copy link
Contributor

Could you please clarify the expected behavior for the code and post-date blocks? Where are you taking those screencasts from?

The Code block should always have a slightly lighter or darker color than the background (usually Tertiary). And the Post Date should just have an accessible color.

@carolinan
Copy link
Contributor

carolinan commented Oct 31, 2024

I have seen the code block issue: I let it slide because the text is always visible on all variations, so it is still accessible.

@beafialho
Copy link
Contributor

Yes, the code block isn't necessarily a bug because it is readable.

@juanfra
Copy link
Member

juanfra commented Oct 31, 2024

Ok, I pushed changes for the date block, and left the code block as is. For the date block on different sections, I chose the current color at 85%.

Code to test
<!-- wp:group {"metadata":{"name":"Style 1"},"className":"is-style-section-1","style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30","left":"var:preset|spacing|30","right":"var:preset|spacing|30"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group is-style-section-1" style="padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)"><!-- wp:paragraph -->
<p>Style 1</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:group {"metadata":{"name":"Style 2"},"className":"is-style-section-2","style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30","left":"var:preset|spacing|30","right":"var:preset|spacing|30"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group is-style-section-2" style="padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)"><!-- wp:paragraph -->
<p>Style 2</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:group {"metadata":{"name":"Style 3"},"className":"is-style-section-3","style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30","left":"var:preset|spacing|30","right":"var:preset|spacing|30"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group is-style-section-3" style="padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)"><!-- wp:paragraph -->
<p>Style 3</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:group {"metadata":{"name":"Style 4"},"className":"is-style-section-4","style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30","left":"var:preset|spacing|30","right":"var:preset|spacing|30"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group is-style-section-4" style="padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)"><!-- wp:paragraph -->
<p>Style 4</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:group {"metadata":{"name":"Style 5"},"className":"is-style-section-5","style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30","left":"var:preset|spacing|30","right":"var:preset|spacing|30"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group is-style-section-5" style="padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)"><!-- wp:paragraph -->
<p>Style 5</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:group {"className":"is-style-default","layout":{"type":"constrained"}} -->
<div class="wp-block-group is-style-default"><!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button">Standard button</a></div>
<!-- /wp:button -->

<!-- wp:button {"className":"is-style-outline"} -->
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link wp-element-button">Outline</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons --></div>
<!-- /wp:group -->

<!-- wp:group {"className":"is-style-section-1","style":{"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50","left":"var:preset|spacing|50","right":"var:preset|spacing|50"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group is-style-section-1" style="padding-top:var(--wp--preset--spacing--50);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50);padding-left:var(--wp--preset--spacing--50)"><!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Heading - Style 1</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Section style 1 (but with extra padding...). And <a href="#">a link</a></p>
<!-- /wp:paragraph -->

<!-- wp:group {"layout":{"type":"flex","orientation":"vertical"}} -->
<div class="wp-block-group"><!-- wp:paragraph {"className":"is-style-pill is-style-text-annotation"} -->
<p class="is-style-pill is-style-text-annotation">Annotation style</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="#">A standard button</a></div>
<!-- /wp:button -->

<!-- wp:button {"className":"is-style-outline"} -->
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link wp-element-button" href="#">An outlined button</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->

<!-- wp:quote -->
<blockquote class="wp-block-quote"><!-- wp:paragraph {"style":{"typography":{"writingMode":"horizontal-tb"}}} -->
<p style="writing-mode:horizontal-tb">“Early in my career...I had to choose between an honest <a href="http://blocks.local/section-styles/" data-type="page" data-id="3437">arrogance</a> and a hypercritical humility... I deliberately choose an honest arrogance, and I've never been sorry.”</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"fontSize":"small"} -->
<p class="has-small-font-size">Frank Lloyd Wright</p>
<!-- /wp:paragraph --></blockquote>
<!-- /wp:quote -->

<!-- wp:pullquote -->
<figure class="wp-block-pullquote"><blockquote><p>“Early in my career...I had to choose between an honest <a href="http://blocks.local/section-styles/" data-type="page" data-id="3437">arrogance</a> and a hypercritical humility... I deliberately choose an honest arrogance, and I've never been sorry.”</p><cite>Frank Lloyd Wright</cite></blockquote></figure>
<!-- /wp:pullquote -->

<!-- wp:post-date /--></div>
<!-- /wp:group -->

<!-- wp:group {"className":"is-style-section-2","style":{"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50","left":"var:preset|spacing|50","right":"var:preset|spacing|50"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group is-style-section-2" style="padding-top:var(--wp--preset--spacing--50);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50);padding-left:var(--wp--preset--spacing--50)"><!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Heading - Style 2</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Section style 2 (but with extra padding...). And <a href="#">a link</a></p>
<!-- /wp:paragraph -->

<!-- wp:group {"layout":{"type":"flex","orientation":"vertical"}} -->
<div class="wp-block-group"><!-- wp:paragraph {"className":"is-style-pill is-style-text-annotation"} -->
<p class="is-style-pill is-style-text-annotation">Annotation style</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="#">A standard button</a></div>
<!-- /wp:button -->

<!-- wp:button {"className":"is-style-outline"} -->
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link wp-element-button" href="#">An outlined button</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->

<!-- wp:quote -->
<blockquote class="wp-block-quote"><!-- wp:paragraph {"style":{"typography":{"writingMode":"horizontal-tb"}}} -->
<p style="writing-mode:horizontal-tb">“Early in my career...I had to choose between an honest <a href="http://blocks.local/section-styles/" data-type="page" data-id="3437">arrogance</a> and a hypercritical humility... I deliberately choose an honest arrogance, and I've never been sorry.”</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"fontSize":"small"} -->
<p class="has-small-font-size">Frank Lloyd Wright</p>
<!-- /wp:paragraph --></blockquote>
<!-- /wp:quote -->

<!-- wp:pullquote -->
<figure class="wp-block-pullquote"><blockquote><p>“Early in my career...I had to choose between an honest <a href="http://blocks.local/section-styles/" data-type="page" data-id="3437">arrogance</a> and a hypercritical humility... I deliberately choose an honest arrogance, and I've never been sorry.”</p><cite>Frank Lloyd Wright</cite></blockquote></figure>
<!-- /wp:pullquote -->

<!-- wp:post-date /--></div>
<!-- /wp:group -->

<!-- wp:group {"className":"is-style-section-3","style":{"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50","left":"var:preset|spacing|50","right":"var:preset|spacing|50"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group is-style-section-3" style="padding-top:var(--wp--preset--spacing--50);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50);padding-left:var(--wp--preset--spacing--50)"><!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Heading - Style 3</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Section style 3 (but with extra padding...). And <a href="#">a link</a></p>
<!-- /wp:paragraph -->

<!-- wp:group {"layout":{"type":"flex","orientation":"vertical"}} -->
<div class="wp-block-group"><!-- wp:paragraph {"className":"is-style-pill is-style-text-annotation"} -->
<p class="is-style-pill is-style-text-annotation">Annotation style</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="#">A standard button</a></div>
<!-- /wp:button -->

<!-- wp:button {"className":"is-style-outline"} -->
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link wp-element-button" href="#">An outlined button</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->

<!-- wp:quote -->
<blockquote class="wp-block-quote"><!-- wp:paragraph {"style":{"typography":{"writingMode":"horizontal-tb"}}} -->
<p style="writing-mode:horizontal-tb">“Early in my career...I had to choose between an honest <a href="http://blocks.local/section-styles/" data-type="page" data-id="3437">arrogance</a> and a hypercritical humility... I deliberately choose an honest arrogance, and I've never been sorry.”</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"fontSize":"small"} -->
<p class="has-small-font-size">Frank Lloyd Wright</p>
<!-- /wp:paragraph --></blockquote>
<!-- /wp:quote -->

<!-- wp:pullquote -->
<figure class="wp-block-pullquote"><blockquote><p>“Early in my career...I had to choose between an honest <a href="http://blocks.local/section-styles/" data-type="page" data-id="3437">arrogance</a> and a hypercritical humility... I deliberately choose an honest arrogance, and I've never been sorry.”</p><cite>Frank Lloyd Wright</cite></blockquote></figure>
<!-- /wp:pullquote -->

<!-- wp:post-date /--></div>
<!-- /wp:group -->

<!-- wp:group {"className":"is-style-section-4","style":{"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50","left":"var:preset|spacing|50","right":"var:preset|spacing|50"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group is-style-section-4" style="padding-top:var(--wp--preset--spacing--50);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50);padding-left:var(--wp--preset--spacing--50)"><!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Heading - Style 4</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Section style 4 (but with extra padding...). And <a href="#">a link</a></p>
<!-- /wp:paragraph -->

<!-- wp:group {"layout":{"type":"flex","orientation":"vertical"}} -->
<div class="wp-block-group"><!-- wp:paragraph {"className":"is-style-pill is-style-text-annotation"} -->
<p class="is-style-pill is-style-text-annotation">Annotation style</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="#">A standard button</a></div>
<!-- /wp:button -->

<!-- wp:button {"className":"is-style-outline"} -->
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link wp-element-button" href="#">An outlined button</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->

<!-- wp:quote -->
<blockquote class="wp-block-quote"><!-- wp:paragraph {"style":{"typography":{"writingMode":"horizontal-tb"}}} -->
<p style="writing-mode:horizontal-tb">“Early in my career...I had to choose between an honest <a href="http://blocks.local/section-styles/" data-type="page" data-id="3437">arrogance</a> and a hypercritical humility... I deliberately choose an honest arrogance, and I've never been sorry.”</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"fontSize":"small"} -->
<p class="has-small-font-size">Frank Lloyd Wright</p>
<!-- /wp:paragraph --></blockquote>
<!-- /wp:quote -->

<!-- wp:pullquote -->
<figure class="wp-block-pullquote"><blockquote><p>“Early in my career...I had to choose between an honest <a href="http://blocks.local/section-styles/" data-type="page" data-id="3437">arrogance</a> and a hypercritical humility... I deliberately choose an honest arrogance, and I've never been sorry.”</p><cite>Frank Lloyd Wright</cite></blockquote></figure>
<!-- /wp:pullquote -->

<!-- wp:post-date /--></div>
<!-- /wp:group -->

<!-- wp:group {"className":"is-style-section-5","style":{"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50","left":"var:preset|spacing|50","right":"var:preset|spacing|50"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group is-style-section-5" style="padding-top:var(--wp--preset--spacing--50);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50);padding-left:var(--wp--preset--spacing--50)"><!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Heading - Style 5</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Section style 5 (but with extra padding...). And <a href="#">a link</a></p>
<!-- /wp:paragraph -->

<!-- wp:group {"layout":{"type":"flex","orientation":"vertical"}} -->
<div class="wp-block-group"><!-- wp:paragraph {"className":"is-style-pill is-style-text-annotation"} -->
<p class="is-style-pill is-style-text-annotation">Annotation style</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="#">A standard button</a></div>
<!-- /wp:button -->

<!-- wp:button {"className":"is-style-outline"} -->
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link wp-element-button" href="#">An outlined button</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->

<!-- wp:quote -->
<blockquote class="wp-block-quote"><!-- wp:paragraph {"style":{"typography":{"writingMode":"horizontal-tb"}}} -->
<p style="writing-mode:horizontal-tb">“Early in my career...I had to choose between an honest <a href="http://blocks.local/section-styles/" data-type="page" data-id="3437">arrogance</a> and a hypercritical humility... I deliberately choose an honest arrogance, and I've never been sorry.”</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"fontSize":"small"} -->
<p class="has-small-font-size">Frank Lloyd Wright</p>
<!-- /wp:paragraph --></blockquote>
<!-- /wp:quote -->

<!-- wp:pullquote -->
<figure class="wp-block-pullquote"><blockquote><p>“Early in my career...I had to choose between an honest <a href="http://blocks.local/section-styles/" data-type="page" data-id="3437">arrogance</a> and a hypercritical humility... I deliberately choose an honest arrogance, and I've never been sorry.”</p><cite>Frank Lloyd Wright</cite></blockquote></figure>
<!-- /wp:pullquote -->

<!-- wp:post-date /--></div>
<!-- /wp:group -->
Screen.Recording.2024-10-31.at.11.22.58.mov

@beafialho
Copy link
Contributor

Thank you! It's working now, the slight opacity gives it exactly the intended look 🚀 If it's easy, I wonder if we could use the same approach for the code block background? If not, we can just move on.

@juanfra
Copy link
Member

juanfra commented Oct 31, 2024

Thank you! It's working now, the slight opacity gives it exactly the intended look 🚀 If it's easy, I wonder if we could use the same approach for the code block background? If not, we can just move on.

@beafialho That's not possible on backgrounds, as we're using currentColor, which takes the color property.

@juanfra
Copy link
Member

juanfra commented Nov 4, 2024

After discussing this with Carolina and Bea, we're merging it.

@juanfra juanfra merged commit 40b5281 into trunk Nov 4, 2024
4 checks passed
@juanfra juanfra deleted the tweak/variations branch November 4, 2024 11:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
[Type] Bug An existing feature does not function as intended.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Difficult to modify colors when a section style is applied
4 participants