Tag: less

当有两个使用variables时,node.js减less了背景属性

我有一个问题less: @frames_color: #faeacd; @menu_color_hex: #faeacd; @menu_color_rgba: rgba(250, 234 ,205 , 255); less用: .topmenu { a { background-color: @menu_color_hex; background-color: @menu_color_rgba; } } 结果在CSS: #user_field .topmenu a { background-color: #faeacd; } 和 .topmenu { a { background-color: green; background-color: @menu_color_hex; background-color: red; background-color: @menu_color_rgba; background-color: blue; } } 结果是: #user_field .topmenu a { background-color: green; background-color: […]

每次保存文档时,如何编译LESS文件?

我已经通过npm这样安装了Less $ npm install -g less 现在,每当我想将源文件编译为.css,我就运行 $ lessc styles.less styles.css 有没有办法通过命令行让我听到,当我保存文件自动编译它?

LESS崇高文本构build系统的问题

在OS X 10.7.2上,我在Sublime Text 2中创build了一个小的构build系统,它将我的LESS文件编译成CSS,但似乎有问题。 { "cmd": ["/usr/local/lib/node_modules/less/bin/lessc", "-x", "$file", "$file_path/$file_base_name.css"], "selector": ["source.less"] } 我已经使用标准的OS X安装程序包安装了Node.js v0.6.6,并且使用npm在/usr/local/lib/node_modules文件夹中安装了较less的v1.1.6。 切换到我的生成系统工作正常,但是当我尝试运行生成时,我得到以下错误信息: [Finished]env: node: No such file or directory 从terminal运行命令工作得很好,这只是崇高的问题。

是否有可能使用gruntjs和/或lesscss将所有的CSS放在一行?

所有的.js和.less文件都是在我的项目中用gruntjs(内置.js支持)和grunt-less-contrib插件在.less文件中完成的。 一时间,lesscss以一种每行定义的方式压缩css,比如下面的.less文件: div,span,textarea,input { margin:0; } 它会输出: div, span, textarea, input { margin:0; } 我想压缩所有的CSS到一行,对于这个例子,它应该是这样的: div,span,textarea,input{margin:0;}…other styles… 可能吗? 任何build议都会有所帮助,我不确定这是一个直接的问题。 也许可以在构buildbuild.css之后添加一个任务,然后执行串联?

使用Grunt和grunt-contrib-cssmin删除注释

我试图使用Grunt和grunt-contrib-cssmin删除所有的CSS注释,CSS文件被编译和缩小它有所有评论。 注释应该删除行:keepSpecialComments:0 module.exports = function(grunt) { require('jit-grunt')(grunt); grunt.initConfig({ less: { development: { options: { compress: true, yuicompress: true, optimization: 2 }, files: { "css/main.css": "less/bootstrap.less" // destination file and source file } } }, watch: { styles: { files: ['less/**/*.less'], // which files to watch tasks: ['less'], options: { nospawn: true } }, }, cssmin: […]

Grunt手表在转换成css的同时立即停止

我有一个轻微的问题,咕噜,less和文件观看。 我用grunt编译我的较less的代码到压缩的css代码。 我的代码工作正常约一分钟,然后进程不会编译我的less文件,我必须closuresterminal在我的Mac,并再次启动咕噜声进程。 rest后,你会发现我的Gruntfile.js和我的terminal读数。 我希望你能帮助我:)谢谢你的时间! 最好的祝福! Gruntfile.js: module.exports = function(grunt) { grunt.initConfig({ less: { development: { options: { compress: true, yuicompress: true, optimization: 2 }, files: { "assets/css/style.css": "assets/less/style.less" } } }, watch: { styles: { files: ['assets/**/*.less'], tasks: ['less:development'], options: { nospawn: true } } } }); grunt.loadNpmTasks('grunt-contrib-less'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.registerTask('default', [ 'less:development', 'watch' ]); […]

在崇高文本中构build更less2

编辑的问题。 这是现在只是关于build设在SUBLIME文本2更less。 我已经尝试了Less-Build和Less2Css。 前者说: [Errno 2] No such file or directory [cmd: [u'lessc', u'/Users/Alex/Public/CrapMates/Mockups/less/listings.less', u'/Users/Alex/Public/CrapMates/Mockups/css/listings.css', u'–verbose']] [dir: /Users/Alex/Public/CrapMates/Mockups/less] [path: /usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin] [Finished] 它是指“cmd”部分还是“path”? 阅读完一些指南后,我已经将LESS命令的目录添加到了我的$ PATHvariables中。 Less2css警告我保存说: 找不到lessc。 我想这是同样的问题。 任何帮助?

meteorless源地图不会被加载到客户端

我尝试在我的项目中获得更less的源地图,但是他们似乎并没有传递给客户端。 > meteor –version > Release 0.8.1.3 > lessc –version > lessc 1.7.0 (LESS Compiler) [JavaScript] > less .meteor/packages |grep less > less > ls .meteor/local/build/programs/client > -rw-r–r– 1 mhhf staff 342679 Jun 6 13:05 473be00fc614aeff1b93b555c76b905fcc71e56b.css > -rw-r–r– 1 mhhf staff 463306 Jun 6 13:05 473be00fc614aeff1b93b555c76b905fcc71e56b.css.map > less .meteor/local/build/programs/client/program.json > … > { "path": "473be00fc614aeff1b93b555c76b905fcc71e56b.css", […]

在类select器上LESS“无法识别的input”有什么可能的原因?

LESS正在投掷 ParseError: Unrecognized input in [filepath] on line 120, column 3: 119 .transition(width 0.32s, height 0.32s, left 0.32s, top 0.32s); 120 .room { 121 display: inline-block; 第3列是. 。 我查看了我的代码,找不到任何理由。 在没有改变结果之前评论说明。 在下一个级别声明中.room{及其匹配的结果}被标记,同样莫名其妙。 我已经做了一些研究,但是大部分关于“无法识别的input”的信息都与@import声明或variables的使用有关,这两者我都没有做。 因为LESS可能会涉及很多,所以我为自己的问题编写了一个回购协议: https : //github.com/theqwertman/less-sample-for-debugging 使用全球通过NPM安装的LESS版本1.7.5。

Grunt watch&LESS – 如何让它更快? (只编译已更改的文件)

我有一个基本的应用程序使用LESS和grunt watch来即时编译更改。 由于很长一段时间我抱怨说,当我改变任何LESS文件,所有得到重新编译。 我浪费时间,不能仅仅编译所需的东西。 但我希望它很聪明,所以如果有任何import它也会编译受影响的文件,而不仅仅是被修改的文件。 今天我决定解决这个问题。 这并不容易。 Grunt手表并不关心这一点,即使使用grunt-newer也没有解决,在这两种情况下都需要编写自定义规则。 最后,我没有使用https://github.com/tschaub/grunt-newer,因为它不适合使用grunt-sync,但更重要的是,由于它不适合我的需求,因为它可以“对付LESSimport的东西,所以它不会编译相关的文件,但只有文件被更改,这不是“聪明”。 (可以对其进行定制以考虑这种东西,而且人们提供了一些要点,但没有任何官方的回购,所以很难find你需要的东西,但绝对值得一看。) 这是一个问题多次问,没有真正的或简单的答案。 看到: 你如何看多个文件,但只能在Grunt.js中运行更改后的文件的任务? Grunt watch:只编译一个文件不是全部 Grunt只监视更改的文件 Grunt:观看多个文件,只编译更改 https://github.com/tschaub/grunt-newer/issues/29 https://gist.github.com/cgmartin/10328349