首页 > 如何利用grunt 使修改后的 bootstrap 的 less 文件,如variables.less 生效?

如何利用grunt 使修改后的 bootstrap 的 less 文件,如variables.less 生效?

我使用bower下载完bootstrap,然后想修改bootstrap中的一些css,比如我想修改navbarborder-radius0px, 我就修改了bootstrap/less/variables.less中的border-radius-base等变量,然后在 bootstrap/下执行 grunt dist命令。结果如:

➜  bootstrap git:(home) ✗ grunt dist
Running "clean:dist" (clean) task
>> 1 path cleaned.

Running "less:compileCore" (less) task
>> 1 stylesheet created.
>> 1 sourcemap created.

Running "less:compileTheme" (less) task
>> 1 stylesheet created.
>> 1 sourcemap created.

Running "autoprefixer:core" (autoprefixer) task
>> 1 autoprefixed stylesheet created.
>> 1 sourcemap created.

Running "autoprefixer:theme" (autoprefixer) task
>> 1 autoprefixed stylesheet created.
>> 1 sourcemap created.

Running "csscomb:dist" (csscomb) task
>> Using custom config file "less/.csscomb.json"...
>> Sorting file "dist/css/bootstrap-theme.css"...
>> Sorting file "dist/css/bootstrap.css"...

Running "cssmin:minifyCore" (cssmin) task
>> 1 sourcemap created.
>> 1 file created. 145.97 kB → 121.13 kB

Running "cssmin:minifyTheme" (cssmin) task
>> 1 sourcemap created.
>> 1 file created. 26.13 kB → 23.4 kB

Running "copy:fonts" (copy) task
Copied 5 files

Running "concat:bootstrap" (concat) task
File dist/js/bootstrap.js created.

Running "uglify:core" (uglify) task
>> 1 file created.

Running "commonjs" task
File dist/js/npm.js created.

Done, without errors.


Execution Time (2016-03-04 12:03:05 UTC)
less:compileCore    812ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 24%
less:compileTheme   109ms  ▇▇▇▇▇ 3%
autoprefixer:core   391ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 12%
autoprefixer:theme   51ms  ▇▇▇ 2%
csscomb:dist         1.3s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 37%
cssmin:minifyCore   260ms  ▇▇▇▇▇▇▇▇▇▇▇ 8%
uglify:core         441ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 13%
Total 3.4s

看上去都没问题,但是默认的border-radius = 4px的效果还是在的,即并没有生效。
那么,我到底做错了什么呢?

ps,本人主要是使用世界上最好的语言。

【热门文章】
【热门文章】