Why gives Grunt / Recess an error and Lessc not when compiling Bootstrap 3 RC1?

蓝咒 提交于 2019-12-04 04:17:07

问题


I add some code to mixins.less:

 img {   &:extend(.img-responsive); }

See also: Images not responsive by default in Twitter Bootstrap 3? and https://stackoverflow.com/a/15573240/1596547

When i run grunt dist from the command line i got:

Running "recess:bootstrap" (recess) task
>> Parser error in less/mixins.less
>>      549. img {
>>      550.   &:extend(.img-responsive);
>>      551. }
Warning:  Use --force to continue.

Aborted due to warnings.

But when i compile it with Lessc: lessc bootstrap.less i don't find an error. (lessc 1.4.2 (LESS Compiler) [JavaScript] )

&:extend needs Less 1.4.0. So grunt / recess use a different compiler?

update running install grunt-contrib-less --save-dev gives:

grunt-contrib-less@0.7.0 node_modules/grunt-contrib-less
├── grunt-lib-contrib@0.6.1 (zlib-browserify@0.0.1)
└── less@1.4.2 (mime@1.2.11, mkdirp@0.3.5, ycssmin@1.0.1, request@2.27.0)

so i expect less v1.4.2 but still got this error


回答1:


It depends on the version of grunt-contrib-less you have.

Run:

npm update grunt-contrib-less


来源:https://stackoverflow.com/questions/17935703/why-gives-grunt-recess-an-error-and-lessc-not-when-compiling-bootstrap-3-rc1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!