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

CSS: Update class name after gutenberg 13.7 change #222

Merged
merged 1 commit 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. In _common, the selector is necessary for specificity, so use wp-block-* instead. In logos, it's not needed for specificity, so it's been removed.

Before After
before-header after-header
before-footer after-footer

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.
@ryelle ryelle self-assigned this Jul 21, 2022
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.

:shipit: LGTM

@andrewserong
Copy link

Just copy+pasting a similar comment from WordPress/wporg-news-2021#387 for visibility:


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!

@ryelle ryelle merged commit 6e62a5b into trunk Jul 26, 2022
@ryelle ryelle deleted the fix/removed-block-class branch July 26, 2022 20:25
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.

3 participants