External style sheet is not valid in AMP pages

I am converting my HTML page to AMP pages. I saw the test URL https://validator.ampproject.org/# . This page is verified with AMP.

Screen shot for reference: enter image description here

But when I used External Css.

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/css/materialize.min.css"> 

Then he will fail.

Screen shot For reference. enter image description here

Then how can I access the cssizeize file. Because I use the Materialize Ui framework on my website.

But I also read about

  <style amp-custom> </style> 

SO AMP confirmation page offers to enable embedded css in amp-custom. But materialize css for so long. It will be broken in some mobile browsers. Because https://github.com/ampproject/amphtml/issues/4555

If anyone has any idea, please share.

+1
source share
1 answer

External style sheets are not allowed in AMP. You must include the CSS declaration itself (up to 10,000 lines) between them. This is to save time due to additional network request and block rendering.

 <style amp-custom> ... </style> 
+4
source

Source: https://habr.com/ru/post/1245446/


All Articles