Inline css question?
Inline css?inline may fail to inline unexpectedly, I don't know how to determine this error situation For example, in my project there is a html main.js?inline, style.css?inline are all inlined normally, but I added several style2.css?inline... They can't be inlined normally, but are independent CSS
In order to reproduce the bug, a test2 project was created. The path configuration is the same but the files are different. The css is simplified and inlined normally. Once the css of the project is replaced with test, the problem occurs. Then the replaced css content is deleted to one line of code, but it still cannot be packaged.
Try changing the file name index.css to new.css, but it still doesn't work
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel='stylesheet' href='new.css?inline' />
</head>
<body>
</body>
</html>
Hello @niansanchujiu,
thanks for the issue report. I try to reproduce and fix it.
@niansanchujiu
I can't reproduce the issue. The description of the issue is not clear defined. Please create a small repo with reproducible issue.
As reference take please the test case. On the base of this test case create your own repo with reproducible issue.
@webdiscus Not sure when it will appear, it took a lot of attempts to reproduce it, try this case
@niansanchujiu
thanks for the repo. I can reproduce the issue. I will fix it.
@niansanchujiu
your HTML contains single quote (') for attributes therefore the parser don't find the CSS correct.
HTML specification allow using both the double " and single ' quotes for attributes. But best practice is using double quotes ".
Workaround
instead of single quotes:
<link rel='stylesheet' href='@pages/index/index.css?inline' />
<link rel='stylesheet' href='@styles/css.css?inline' />
use the double quotes:
<link rel="stylesheet" href="@pages/index/index.css?inline" />
<link rel="stylesheet" href="@styles/css.css?inline" />
P.S.
I will fix the bug with single quotes.
@niansanchujiu
I have fixed the issue. Can you please test your project with the new version 4.4.3?
Thanks!
@webdiscus There is no problem at present, it should be the quotation mark problem. Thanks for the timely reply and solution