-
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
Section Styles: unecessary additional CSS output #62457
Comments
@aaronrobertshaw - just wanted to get this on your radar. |
Thanks for the ping and writing up the detailed issue @colorful-tones 👍 Removing the old
This might be worth a separate issue.
This CSS is what is planned to be removed.
These are the per-application styles for the variation. They are required to be attached to the individual block instance that they are applied to so that these block style variations can be nested in any order for example:
I'll need to dig into this later today and will update accordingly. |
👍
I've updated this issue to remove that bit. I did some further testing and I believe it was a user error on my end. All is working fine for child theme behavior.
👍
👍
Thanks! 👍 |
Description
While testing the Section Styles I found some oddities in the CSS output. Some additional and unnecessary CSS is output, which is not ideal and should be restricted with some further code enhancements.
Testing instructions are below.
Step-by-step reproduction instructions
I've attempted to create a reduced test case.
twentytwentyfour/styles/mock.json
with the following code: https://gist.github.com/colorful-tones/56c090ab4b458cdfc77025dd076889e5#file-twentytwentyfour-mock-jsonmock
to see all the styles output.Notice that there are multiple entries for CSS being output and I'm not totally clear as to why. For example, with only a single
<p class="is-style-mock is-style-mock--e1aa201d31a4b92642d4459514f98ae8">some text</p>
element on the page - I see the following CSS being output on the front end of the site (in top-down order of being output on the page)First related
mock
CSS output on the page:Second instance of
mock
CSS output on the page:Note: the original block id associated with the final
<p>
class ise1aa201d31a4b92642d4459514f98ae8
, which matches the last declaration forp.is-style-mock--1aa4a837b1ec90d53ffc7707030b43c1
. However, where is thep.is-style-mock--e1aa201d31a4b92642d4459514f98ae8
even coming from and being output on the page? Why are there two declarations of the same and both targetingp.is-style-mock
(one just being more specific with--1aa4a837b1ec90d53ffc7707030b43c1
)?I feel like the expected outcome would be to just see the only following CSS output on the page.
Screenshots, screen recording, code snippet
section-styles-css-output.mp4
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: