What problem does this address?
A popular plugin, Greenshift, has a feature that allows lazy loading patterns in pages (they actually still call patterns "reusable template parts"). The feature is very powerful for situations where you have long pages that end up making both editing and browsing heavy.
The dynamic loading itself works. However, if the Ajax loading is used, some styling goes broken. Specially those related to core container classes, such as .wp-container-core-group-is-layout-<some-index> from a Group Block. The reason seems obvious… when I inspect the browser I can see that there are two elements with the same class, one from one reusable template part, another from the lazy-loaded one.
So it looks that the way WordPress renders the dedicated css for each of these classes won’t work because not all page is loaded from start, thus it cannot properly parse the content to create the indexes. I brought this up to the plugin developers in their forum and it seems that they aren't aware of a way to overcome this issue.
Due to that I believe it might be something that could use some help from the core side. I asked @ndiego earlier for help to see if we can come up with a solution.
What is your proposed solution?
I guess messing with this engine is possibly very complex and I don't understand the internals. From my naive point of view, things that come in mind are:
- A filter that could allow extenders to disable this dynamic index-based styling logic. At first I thought the
disable-layout-styles theme support was related but now I see that it has impact on other settings;
- An action that could allow extenders to detect when these indexes are being rendered, so that situations like this dynamic rendering could be managed by them... maybe invoking the rendering by themselves?
- Even better, some logic in core itself to detect that things are loaded later in order to take account of this elements when creating the indexes? I'm not sure but maybe the same problem could affect other situations where blocks are lazy loaded...
What problem does this address?
A popular plugin, Greenshift, has a feature that allows lazy loading patterns in pages (they actually still call patterns "reusable template parts"). The feature is very powerful for situations where you have long pages that end up making both editing and browsing heavy.
The dynamic loading itself works. However, if the Ajax loading is used, some styling goes broken. Specially those related to core container classes, such as
.wp-container-core-group-is-layout-<some-index>from a Group Block. The reason seems obvious… when I inspect the browser I can see that there are two elements with the same class, one from one reusable template part, another from the lazy-loaded one.So it looks that the way WordPress renders the dedicated css for each of these classes won’t work because not all page is loaded from start, thus it cannot properly parse the content to create the indexes. I brought this up to the plugin developers in their forum and it seems that they aren't aware of a way to overcome this issue.
Due to that I believe it might be something that could use some help from the core side. I asked @ndiego earlier for help to see if we can come up with a solution.
What is your proposed solution?
I guess messing with this engine is possibly very complex and I don't understand the internals. From my naive point of view, things that come in mind are:
disable-layout-stylestheme support was related but now I see that it has impact on other settings;