简体   繁体   中英

Less: process less and CSS files

I've a project with less and CSS files mixed (vendor stuff). I want to optimize all files either CSS or less to one merged CSS file. Usually I've one less file which imports all needed files. But it doesn't work with imported CSS files. It just export the "import "foo.css"" to the merged CSS file.

How can I do that?

Use @import (inline) directive. You can read more about it here .

I suggest to treat .css files imported like they would be .less with the following syntax:

@import (less) "foo.css";

This results in a final compiled .css file that include rows from original .css imported one, followed by processed LESS rows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM