Section Styles: unecessary additional CSS output #62457
Labels
[Feature] Block Style Variations
Issues or PRs that are related to the style variations for blocks
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
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: