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

Restore more specific CSS for paragraph block custom color classes #13821

Merged

Conversation

kjellr
Copy link
Contributor

@kjellr kjellr commented Feb 11, 2019

This extra specificity was removed in #13025, but should be restored because other blocks (buttons, pullquotes, etc), use the has-background and has-text-color classes. We don't want the styles here to interfere.

Related discussion in #13025:
https://github.com/WordPress/gutenberg/pull/13025/files#r255619634

Before:
screen shot 2019-02-11 at 2 51 55 pm
^ Button is inheriting additional padding because of the has-background-color class.

After:
screen shot 2019-02-11 at 2 52 18 pm
^ Button is no longer inheriting additional padding.


A couple minor notes:

  • This uses a p selector here, rather than something like .wp-block-paragraph so that the styles get picked up correctly on the front-end as well.
  • The other specificity changes in that file (font size and dropcap) aren't causing issues because those classnames are only used in this context for now.

This extra specificity was removed in #13025, but should be restored because other blocks (buttons, pullquotes, etc),  use the `has-background` and `has-text-color` classes. We don't want the styles here to interfere.

Using a `p` selector here, rather than something like `.wp-block-paragraph` so that this gets picked up correctly on the front-end as well.
@kjellr kjellr added [Type] Bug An existing feature does not function as intended [Block] Paragraph Affects the Paragraph Block labels Feb 11, 2019
@kjellr kjellr self-assigned this Feb 11, 2019
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.

Yerp.

@gziolo gziolo added this to the 5.1 (Gutenberg) milestone Feb 12, 2019
@kjellr kjellr merged commit e9f6ddd into master Feb 12, 2019
@kjellr kjellr deleted the fix/custom-colors-css-specificity-for-paragraph-block branch February 12, 2019 13:27
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
…13821)

This extra specificity was removed in #13025, but should be restored because other blocks (buttons, pullquotes, etc),  use the `has-background` and `has-text-color` classes. We don't want the styles here to interfere.

Using a `p` selector here, rather than something like `.wp-block-paragraph` so that this gets picked up correctly on the front-end as well.
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
…13821)

This extra specificity was removed in #13025, but should be restored because other blocks (buttons, pullquotes, etc),  use the `has-background` and `has-text-color` classes. We don't want the styles here to interfere.

Using a `p` selector here, rather than something like `.wp-block-paragraph` so that this gets picked up correctly on the front-end as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Paragraph Affects the Paragraph Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants