Block Visibility: change visibility class#11169
Block Visibility: change visibility class#11169t-hamano wants to merge 2 commits intoWordPress:trunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
ramonjd
left a comment
There was a problem hiding this comment.
LGTM - manually tested and against WordPress/gutenberg#76166
| * they should be sanitized and kebab-cased. | ||
| */ | ||
| $visibility_class = 'wp-block-hidden-' . $hidden_viewport_size; | ||
| $visibility_class = 'is-hidden-on-' . $hidden_viewport_size; |
There was a problem hiding this comment.
Does this class conflict with any existing one themes/plugin? Have you checked that?
I do quick search https://wpdirectory.net/search/01KK0QW5ZCT6GTEZDAMAZ33HXM for themes.
There was a problem hiding this comment.
That's a good question. I wouldn't be against reinstating wp as a namespace. After all it's wp that's generating it.
There was a problem hiding this comment.
There are already other classes that could potentially be in conflict.
is-position-stickyis-nowrapis-layout-constrainedis-repeated
However, it's a good idea to avoid conflicts. For example:
is-block-hidden-on-{viewport}- Search for themes: https://veloria.dev/search/1009fa0e-b751-4433-83f6-0a9397c5e689
- Search for plugins: https://veloria.dev/search/937734d8-bff6-4799-95ad-f09b61a279a0
wp-is-hidden-on-{viewport}- Search for themes: https://veloria.dev/search/7515443e-069c-48a8-91d7-103872a49e77
- Search for plugins: https://veloria.dev/search/856b45fd-e95f-41dd-83e2-920fa8c039a8
As you can see, neither CSS class is likely to conflict with existing themes or plugins.
Personally I prefer is-block-hidden-on-{viewport}. What do you think?
There was a problem hiding this comment.
If we get in first it's ours 😄
I'm ambivalent. My only 2c would be that wp indicates that this is coming from WP core.
Same as what happens for WP block classes:
It might reduce confusion for humans (and bots) looking at the code.
There was a problem hiding this comment.
I thought about it again and began to think that the current CSS class is the least likely to conflict with other themes or plugins, and there's no need to change it now 😅
For now, I'm going to close this pull request. Sorry for the confusion!
Trac ticket: https://core.trac.wordpress.org/ticket/64802
Use of AI Tools
None