Heading Block: Don't rely on the experimental selector anymore#46284
Merged
Conversation
mpkelly
pushed a commit
to mpkelly/gutenberg
that referenced
this pull request
Dec 7, 2022
…ress#46284) * Heading Block: Don't rely on the experimental selector anymore * update unit test with new selector
Contributor
|
flagged for Dev notes in 6.2 |
Contributor
Author
Dev noteGiving block themes more control over headingsTo give themes more fine grained control over styling headings, it is now possible to control heading blocks independently of heading elements. To target all headings themes can target heading elements: To target heading blocks but not any other headings: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What?
Before we had a class name on the heading block, the only way to target it was using this selector
h1,h2,h3,h4,h5,h6. Now we have a class name on the block (#42122), we can remove this __experimentalSelector and revert to the standard selector (.wp-block-heading).Why?
This gives theme.json more control over what it targets - now heading block settings will only apply to heading blocks, not all heading elements.
How?
Simply remove the __experimentalSelector property.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
@WordPress/block-themers