When using the Less precompiled framework, we always hope to efficiently manage the deployment structure of CSS files. Here we will look at a technique for forcing CSS to be packaged into a single file in the Less framework. Friends who need it can refer to it.
less will merge other less files into a single file when importing them.
But when introducing a css file, the css will not be merged by default.
Use the inline keyword to force a.css to be packaged into the final single file:
@import (inline) "./a.css"; p{ color:yellow; }
The compiled result is as follows, there is only one file (a.css has only one a Style)
a{ color:red; } p { color: yellow; }
If there is no inline parameter, the final result is as follows, two files will be requested
@import "a.css"; p { color: yellow; }
The above is the detailed content of Detailed explanation of the technique of forcing CSS to be packaged into a single file in the Less framework. For more information, please follow other related articles on the PHP Chinese website!