如何利用grunt 使修改后的 bootstrap 的 less 文件,如variables.less 生效?
我使用bower
下载完bootstrap,然后想修改bootstrap中的一些css,比如我想修改navbar
的border-radius
为 0px
, 我就修改了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,本人主要是使用世界上最好的语言。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你好,我也是一名前端初学者,我遇到了和您一样的问题,请问您解决了吗?