-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Post Author / Post Excerpt - change editor selector class #24104
Post Author / Post Excerpt - change editor selector class #24104
Conversation
Size Change: +6 B (0%) Total Size: 1.15 MB
ℹ️ View Unchanged
|
Not sure this is the best approach. E.g. <!-- non aligned block -->
<div class="wp-block wp-block-post-author" data-type="core/post-author"></div>
<!-- aligned block -->
<div class="wp-block" data-align="center">
<div class="wp-block-post-author" data-type="core/post-author"></div>
</div> I'd rather suggest we turn these block as light wrapper to be more consistent with pretty much all other Core blocks, and then we might be able to simplify the CSS selector like this: - .wp-block[data-type="core/post-author"].has-link-color .wp-block-post-author a {
+ .wp-block-post-author.has-link-color a { (Unless we need more specificity, but I hope we don't! 🙂 ) |
Agree with @Copons 🙂 |
This choice of selector in the editor is not out of the ordinary, and is used in blocks using the light block wrapper as well:
^^ Even the paragraph block uses this selector for styles in the editor. It is probably preferable to wp-block regardless of using the light block wrapper. We should have used it here from the beginning. I don't disagree that maybe these blocks should have light wrappers added at some point, but I don't see how this simple change doesn't make sense in their current state. Its more of a 'whoops, lets do a quick fix to that last PR that I merged b/c I clearly chose the wrong classname'. |
@Addison-Stavlo Got it! |
Description
Changes the block selector used in the editor.scss from
wp-block
toblock-editor-block-list__block
. As noticed here:gutenberg/packages/block-editor/src/components/block-list/block.js
Lines 148 to 150 in d86cd5f
wp-block
is only added when there is no block alignment set, whileblock-editor-block-list__block
is always added to the wrapper. While this does not create any problems for these blocks currently, it will prevent future conflicts if block alignment support is added.How has this been tested?
Test these blocks in the editor and verify that link colors change along with their selected color.
Screenshots
Types of changes
Checklist: