Questions tagged [grunt-contrib-less]

Compile LESS files to CSS.

Grunt file to compile LESS files to CSS.

58 questions
11
votes
2 answers

How to configure grunt-contrib-less to generate source maps compatible with Chrome DevTools?

The question title pretty much says it all. I don't know how to configure the grunt-contrib-less task that now supports source maps. My expected result is to have Chrome DevTools CSS inspector to point to the Less rules. If possible, it would be…
4
votes
2 answers

How to concatenate (and not compile) several less files into one using grunt

I'm having trouble finding a solution to this problem. I have a less file app.less that only consists of @import statements. Now I want to generate a single less file that includes all imported less files, because I want to send it to the client to…
Peter
  • 621
  • 1
  • 6
  • 16
4
votes
2 answers

With Grunt, how can I compile all *.less files, if I have global mixins and constants?

I want to organize my HTML, JS, and LESS by module. I'm already using Grunt to compile *.js and *.html from my source folders. So I configured grunt as follows: grunt.initConfig({ less: { ALL: { files: { 'compiled.css':…
Scott Rippey
  • 15,614
  • 5
  • 70
  • 85
3
votes
1 answer

How to use the less-plugin-clean-css with grunt-contrib-less?

I am trying to use less-plugin-clean-css with grunt-contrib-less but I am unable to get it to run. It seems the grunt configuration can't find or install the plugin. This is for a fork of bootstrap that I maintain. I have updated the Gruntfile.js…
Caqu
  • 1,154
  • 1
  • 8
  • 14
3
votes
1 answer

Less compiling slow with Grunt

I'm wanting to move over to Grunt to perform my LESS compiling. My LESS files are split up into about 117 files. I've got about 170 imports in total as code is shared between the admin and member areas of my project. I was using LiveReload and it is…
Ben Sinclair
  • 3,896
  • 7
  • 54
  • 94
3
votes
1 answer

Don't compress '0px' in '0' with LESS/CSS minificator

I would like to compress my LESS file where I use the new flexbox display like that : flex: 1 1 0px; I use grunt-contrib-less with the compress option active and the result is: flex: 1 1 0; It's work fine for Chrome and FF, but don't work in IE 11…
Bastien
  • 635
  • 5
  • 16
3
votes
1 answer

grunt-contrib-less not working (no errors but no output css)

I have a less compile grunt task where relative path to less files from grunt installed folder is raw/less/source_map/ here is the grunt file. Gruntfile: (EDIT: changed to @Yogesh Khatri's code still same issue) module.exports = function(grunt) { …
Sagi_Avinash_Varma
  • 1,489
  • 11
  • 23
3
votes
1 answer

Grunt compile all .less to .css in each directory

So I have setup my site to use modules, in which each module has it's own .less file which needs to be compiled into .css. Folder Structure: /common/modules/{module-name}/style.less I need all the style.less files to be converted into style.css…
Quinton Pike
  • 3,823
  • 8
  • 31
  • 37
2
votes
1 answer

Grunt watch & LESS - How to make it faster? (only compiling the files that have been changed)

I have a basic application using LESS and grunt watch to compile changes on the fly. Since a very long time I was complaining about the fact that when I change any LESS file, all get re-compiled. It was such a waste of my time not to be able to…
Vadorequest
  • 16,593
  • 24
  • 118
  • 215
2
votes
0 answers

How to configure Grunt Less Plugin Autoprefixer in Sails.js?

According to the Bootstrap docs, you needs Autoprefixer to compile Bootsrap LESS source files. The grunt-contrib-less compiler supports less-plugin-autoprefix, but I can't get it to work inside Sails. Here is my modified task/config/less.js…
jwogrady
  • 1,570
  • 1
  • 15
  • 22
2
votes
1 answer

How to add line break after banner inside Grunt LESS task options

I'm setting up my gruntfile.js for a new WordPress project in which I'll use LESS for managing CSS. What I'm trying to accomplish here is to add the typical list of informations regarding the theme you can see at the top of every style.css file in a…
vcoppolecchia
  • 398
  • 1
  • 4
  • 18
2
votes
2 answers

Grunt Contrib Less - Sourcemaps -- sourceMapRootpath and sourceMapBasepath ignored

Ok - I'm trying to configure less to spit out a sourcemap and correctly point to the accessible path of the less files. I can get the sourcemap to work properly, but the path it dumps into the sources array in the source map file are always…
SDG
  • 183
  • 2
  • 4
  • 13
2
votes
1 answer

How can I have my source Less files be in a non-public folder and have CSS (their sourcemaps) be public?

I'm using Grunt (grunt-contrib-less) to process my Less files into CSS. This is working, but the sourcemaps are not. My Less files are in /assets/less, and Grunt compiles them into /public/css. /public/ is my folder that is publicly-viewable on the…
Ryan
  • 22,332
  • 31
  • 176
  • 357
2
votes
1 answer

LESS: Unrecognised input "@import ..."

I have a really simply LESS file which for now just imports Bootstrap. I'm using grunt and grunt-contrib-less@0.9.0 to compile the LESS files on save (less@1.6.3). My file looks like this: @charset "utf-8"; /** * This is the root style file for the…
GTF
  • 8,031
  • 5
  • 36
  • 59
1
vote
0 answers

Override Less Mixins

I am fully aware mixins (classes) in Less couldn't be overridden, but maybe some npm packages exist that could do it or smth else? Currently compiling with grunt-contrib-less /// vendor_mixins.less .do-my-css(@color:red) {color: @color; display:…
Anton D.
  • 11
  • 2
1
2 3 4