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

Removed background color from paragraph. Fixed contrast checker on transparent colors. #5845

Conversation

jorgefilipecosta
Copy link
Member

Until now, the paragraph block had a background set to white.
With the recent nesting addition, this is causing us some problems. As noted in the discussions in #5658. In the cover image nesting PR #5452 the background rule is also problematic so this PR removes this rule.

This PR also fixes the contrast checking mechanism to not display an error if the colors we are dealing with contain transparencies. Because if the colors contain transparency we don't know what is below them (it can even be an image) with a big contrast.

How Has This Been Tested?

No noticeable changes should be seen in the paragraph.
If no background is set for a paragraph the contrast checker should never display errors (as in this case the background is transparent) and the theme may have a color with high contrast. If set a background color for the paragraph the contrast checker should work as expected.
If we set a background color for a paragraph using a CSS rule the contrast checking should work as expected in accordance with the background rule set with CSS.
Example css rule.

.wp-block-paragraph {
	background: red;
}

@jorgefilipecosta jorgefilipecosta added the [Type] Enhancement A suggestion for improvement. label Mar 28, 2018
@jorgefilipecosta jorgefilipecosta self-assigned this Mar 28, 2018
@jorgefilipecosta jorgefilipecosta requested a review from a team April 2, 2018 11:50
… to ignore its logic if colors are transparent (impossible to know the color behind).
@jorgefilipecosta jorgefilipecosta force-pushed the update/removed-background-editor-paragraph-updated-contrast-checker-ignore-transparencies branch from 43a23e7 to af191f5 Compare April 2, 2018 21:10
Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

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

👍

@jorgefilipecosta jorgefilipecosta merged commit 0a6cceb into master Apr 4, 2018
@jorgefilipecosta jorgefilipecosta deleted the update/removed-background-editor-paragraph-updated-contrast-checker-ignore-transparencies branch April 4, 2018 14:22
@jorgefilipecosta jorgefilipecosta added this to the 2.6 milestone Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants