Minified CSS replaces CSS entity with HTML tag?
-
First of all, let me say how grateful I am that I can use LiteSpeed cache on most of my client’s sites. I consider this plugin invaluable and without a doubt the highest standard for WP caching I have tried.
One small problem I’ve had is what one client described as a “momentary flash of vertical text while loading”. It took me quite some time to work out what was happening, but today I finally tracked it down to an issue with the auto-generated critical CSS; a
::before
pseudo-element has a character specified using a CSS entity code, which is partially(?) being replaced with HTML in the critical CSS. The HTML doesn’t render as the expected character (it looks malformed to me), causing a moment before the async CSS loads where the extra characters are displayed instead.This screenshot shows a comparison between the source (as loaded asynchronously) and the inline critical CSS. You can see the correct value, CSS entity
\00a0
, in the async section at the top (though disabled in my screenshot because I was testing), and the erroneous value<meta charset="UTF-8" />a0
, in the inline section below.Alternatively this might be a HTML optimisation issue? I don’t know whether it’s happening when the critical CSS is generated, or during HTML optimisation. I do know that turning off HTML minification doesn’t help.
I’m putting a workaround in place for now, but it would be good to know if this is something in the plugin that could be addressed. Thanks! ??
NB: I haven’t supplied the URL due to client privacy. I’m happy to open a private support ticket if you need me to provide more information or link the actual site.
- The topic ‘Minified CSS replaces CSS entity with HTML tag?’ is closed to new replies.