Hi,
I use Toolset blocks, and have created some views.
In the frontend the views/loop output contains style in base64 encoded <div class="tces-js-style-encoded" style="display:none;">Lndwdi12aWV3LW91dHB1dFtkYXRhLX.......
together with every output view/loop.
Why is it there, and can I get rid of it?
I have tried to use another loader.php according to this page.https://toolset.com/errata/base64-encoded-string-may-be-included-in-forms-notifications-or-in-other-plugins-output/
And I have tried to deregister some frontend styles/js, but nothing result in removing the base64 encoded style.
Can you help me?
Best Anders
Why is it there, and can I get rid of it?
Hi, basically these elements are styles specific to each block and you cannot get rid of them in the page source without breaking Blocks display. Custom styles added to Blocks in the Block editor, like margin, padding, font color, etc., are handled this way by design. I suppose a different approach would be to generate some separate CSS file(s) that include these styles, and enqueue them in the page header, but that approach is less performant (extra assets must be loaded). Those styles must be available in the page source when the page loads, but cannot be enqueued before the head tag is completed for technical reasons. The the styles are encoded in hidden DOM elements using base64 for performance and HTML 5 validation reasons, decoded via JavaScript when the page loads, and finally injected into the head tag inside a style tag. There's not an easy way to disable this base64 style management system in the current software. Toolset Blocks styles must be injected in this manner, or none of the styles applied in Blocks will work correctly.
I have tried to use another loader.php according to this page.https://toolset.com/errata/base64-encoded-string-may-be-included-in-forms-notifications-or-in-other-plugins-output/
That's a separate issue in Forms notifications, unrelated to styles being injected into the DOM of a page. I wouldn't expect this loader.php solution to help your case.
My issue is resolved now. Thank you!