Skip Navigation

[Resolved] How to get rid of base64 encoded style

This support ticket is created 3 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by poulP 3 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#1868845

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

#1869447

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.

#1872785

My issue is resolved now. Thank you!