I use twitter bootstrap. In my dev server I connect two less files: bootstrap.less and style.less:
@import "bootstrap.less";
@gridGutterWidth: 30px;
body {...}
I redefined some bootstrap variables in my style.less. How to convert bootstrap.less and style.less to css in this case?
Twitter Bootstrap team has developed its own tool for CSS - recess . It compiles LESS, optimizes CSS, lints and converts it according to BS's style guidance. It is available as Node package, install it with npm
:
npm install recess
You can run it from command-line with:
recess --compile bootstrap.less > bootstrap.css
But preferred way is to use Bootstraps Makefile
by running make bootstrap
in Bootstrap's folder.
您可以使用SimpLESS之类的工具来创建CSS,然后在布局中引用CSS,也可以使用Less.js即时转换为CSS,从而仍然可以在代码中引用LESS文件。
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.