3

Google Page Speed told us, that we have rendering blocking CSS.

Now we try to solve this with CSS Critical Path activated.

We have created a Critical.css file

We have integated the same in our Theme.

All works fine, we try which styles are important and which CSS can load later.

BUT now the source code coming from CSS Critical Path in general adds a weird dot, (like a ".") to the code between media="all" and onload...:

link rel="preload" as="style" media="all" . onload="this.onload=null;this.rel='stylesheet'"href="http:

See here as well.

enter image description here

When running validator.w3.org it says

Error: Attribute . not allowed on element link at this point.

and also

Warning: Attribute . is not serializable as XML 1.0.

So this funny dot (.) is there.

Does anyone of you experts have a clue why this is there and how we could get rid of it?

Any help is so appreciated.

Warm regards

4
  • How have you added this CSS file?
    – Ben Crook
    Jan 22, 2020 at 17:17
  • Hi Ben, we have added the same as per "The ‘critical’ CSS file should be located in app/design/frontend/<your_vendor_name>/<your_theme_name>/web/css/critical.css " like mentioned here: devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-topics/… - using this Penthouse generator jonassebastianohlsson.com/criticalpathcssgenerator Best regards
    – Ben
    Jan 23, 2020 at 17:23
  • Ah I completely forgot M2 supports critical CSS out the box. I haven't seen this problem before but I will be setting critical CSS up on a project soon so if I run into the problem and find a solution I'll provide the answer here.
    – Ben Crook
    Jan 24, 2020 at 9:44
  • Hi guys did you already resolved the issue? Sep 22, 2020 at 15:22

1 Answer 1

0

It is a bug in Magento, fixed in the new version 2.4 see here https://github.com/magento/magento2/pull/26764/commits/f9697f509ae09f5c9e0f0d7b1a2de7ed9a53fc16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.