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

Update CSS for Gutenberg 13.7 #387

Merged
merged 2 commits into from
Jul 26, 2022
Merged

Update CSS for Gutenberg 13.7 #387

merged 2 commits into from
Jul 26, 2022

Conversation

ryelle
Copy link
Contributor

@ryelle ryelle commented Jul 21, 2022

  • The wp-container-* class is no longer added to all blocks, instead we should use the wp-block-* class. The selector is necessary for specificity, so we can't just remove it.
  • Update default link selector — This matches the gutenberg default style, which was overriding the News style due to higher specificity.
Before After
before-home after-home
before-podcast after-podcast

ryelle added 2 commits July 21, 2022 16:59
The `wp-container-*` class is no longer added to all blocks, instead we should use the `wp-block-*` class. The selector is necessary for specificity, so we can't just remove it.
This matches the gutenberg default style, which was overriding the News style due to higher specificity
@ryelle ryelle self-assigned this Jul 21, 2022
@andrewserong
Copy link

Thanks for fixing this up! For visibility, just linking through that this PR was required due to the change introduced in WordPress/gutenberg#40875 that refactored how the Layout block support works. Part of the effort in that PR is to reduce the usage of container ID-based classes in favour of semantic classnames, to help address WordPress/gutenberg#41434 and an overall direction in WordPress/gutenberg#38719.

Targeting the wp-block- classname prefix looks safe to me, as that particular classname structure is very unlikely to change.

For further changes to how the Layout block support works, we're currently tracking work in WordPress/gutenberg#39336. One of the goals is to settle on stable classnames for layout that can be relied upon in themes, and then document these reliable classnames in the handbook. For now, it's great to see that the styling rules here can safely rely upon the wp-block- prefix instead!

Copy link
Contributor

@adamwoodnz adamwoodnz left a comment

Choose a reason for hiding this comment

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

LGTM too

Copy link
Member

@iandunn iandunn left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏻

@ryelle ryelle merged commit 031d9db into trunk Jul 26, 2022
@ryelle ryelle deleted the fix/removed-block-class branch July 26, 2022 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants