Automattic / juice

Juice inlines CSS stylesheets into your HTML source.
MIT License
3.12k stars 221 forks source link

Juice removed the @import style for style #477

Open yongma16 opened 8 months ago

yongma16 commented 8 months ago

Code content:

<link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Tomorrow:300,400,500,700" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css2?family=Goldman:wght@400;700" rel="stylesheet" type="text/css">
<style type="text/css">
  @import url(https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700);
  @import url(https://fonts.googleapis.com/css?family=Tomorrow:300,400,500,700);
  @import url(https://fonts.googleapis.com/css2?family=Goldman:wght@400;700);
</style>

After the run

result:

<link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Tomorrow:300,400,500,700" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css2?family=Goldman:wght@400;700" rel="stylesheet" type="text/css">

Confusion:

Why does juice process code blocks that are reflected in the font style remove @import and leave the link tag?