Questions tagged [less]

Less is an open-source stylesheet preprocessor that extends CSS with dynamic behavior such as variables, mixins, operations and functions. For the UNIX command, use [less-unix].

Less is an open-source stylesheet preprocessor that extends with dynamic behavior such as variables, mixins, operations and functions. It was developed by Alexis Sellier, more commonly known as cloudhead and is now hosted on GitHub.

Less is written in JavaScript and can be run both on the client-side and the server-side (with Node.js, Rhino, etc.). The code compiles the Less syntax into CSS and thus what is ultimately rendered by the browser is CSS, not Less. The syntax itself is similar to CSS and you can use it seamlessly along with regular CSS. The file extension of Less files is .less.

External Links:

Online Less Compilers: (Recommended by the official Less website)

Online Demo Environments:

The following websites (also recommended by the official Less website) can be used to create a live demo of the problem area and can be linked in the question to further illustrate complex problems.


The name less is also the name of a unix command which displays a file. For questions on that topic, use .

7295 questions
3
votes
2 answers

Can't import less files encoded in UTF-8 BOM

I use the less compiler with node.js and I know there is an issue with the files encoded in UTF-8 with BOM. For this, this workaround works great: data = data.replace(/^\uFEFF/, ''); // Strip potential BOM However, when importing files, using…
Jørgen
  • 8,820
  • 9
  • 47
  • 67
3
votes
1 answer

How can I stop the Grails less-resources plugin from compiling my less files every run-app?

Does anyone know how to get the Grails less-resources plugin to cache the compiled .css files and only re-compile if the corresponding .less file(s) have changed? It is adding a lot of time to "grails run-app".
David Tinker
  • 9,383
  • 9
  • 66
  • 98
3
votes
2 answers

inheritance in lesscss, doesn't inherit sub classes

this is my style.less code: .transition { -ms-transition: all 0.3s ease-in-out; -moz-transition: all 0.3s ease-in-out; -o-transition: all 0.3s ease-in-out; -webkit-transition: all 0.3s ease-in-out; transition: all 0.3s…
ahmadali shafiee
  • 4,350
  • 12
  • 56
  • 91
3
votes
2 answers

How do I get Twitter Bootstrap's Less files to work with Sinatra AssetPack?

I am trying to get Bootstrap's Less files working with Sinatra AssetPack, but I am getting Less parser errors. These errors lead me believe that the less files being imported through bootstrap.less are not aware of each other. I have an app.rb…
Eric Levine
  • 13,536
  • 5
  • 49
  • 49
3
votes
1 answer

JSBIN vs LESS CSS

Is it possible to make LESS CSS work with JSBIN? Under Add library we can add Less 1.1.3, but I'm not sure if or how I can make it work. Test: http://jsbin.com/idekiz/1/edit
Kurt
  • 695
  • 3
  • 8
  • 17
3
votes
1 answer

Create dynamic less mixin setting property names

I want to create a less mixin to build up a number of margin/padding rules. I have been able to create the correct mixin for height, width, height percent and width percents. For example, .widthX (@px) when (@px > 0) and (@px =< 30) { …
Phil Bolduc
  • 1,586
  • 1
  • 11
  • 19
3
votes
2 answers

How to align centrally and vertically a div element without using javascript

I am trying to centre, just using css, a div element both vertically and horizontally. All the examples I have seen makes use of hardcoded values like pixel values. Should it be possible to centre a div element without using javascript and using…
Lorraine Bernard
  • 13,000
  • 23
  • 82
  • 134
3
votes
1 answer

LESS mixin advice

Im trying to create a LESS mixin for my font size and line-height but at the moment get an error when I try to run it. Can anyone advise where I might be going wrong with this: .font( @size: 1.6, @line: @size * 1.5 ){ @fontSizeRem: @size; …
styler
  • 15,779
  • 23
  • 81
  • 135
3
votes
2 answers

Javascript library for editing LESS CSS variables?

Assuming that I have a website that uses LESS and utilizes variables; I was wondering if a library or anything exists to provide the end-user the ability to change the variable. For example, if the background color of a class is specified in a…
zallarak
  • 5,287
  • 7
  • 38
  • 54
3
votes
2 answers

How do I export a minified CSS file using client-side less.js?

I have a web project I'm working on and it is using LESS to combine all the files into one CSS for me. However I obviously don't want the client side javascript to have to run in production as that is going to slow things down. Is there a way with…
diggersworld
  • 12,770
  • 24
  • 84
  • 119
3
votes
1 answer

Using LESS for WordPress Theme Options

Curious if anyone has tried something like this/if it would work: Many premium WordPress themes allow the administrator to change theme setting like color and typography and then (typically) either inject CSS directly into the header to override the…
3
votes
1 answer

Twitter Bootstrap Rails - how can I separate my styles from bootstrap_and_overrides.less

I'm using the twitter-bootstrap-rails gem for styles in my app. At the moment, I'm writing all my style ruls inside bootstrap_and_overrides.css.less, and this turns messy and redundant as the application grows. I'd like to split the less code to…
sa125
  • 28,121
  • 38
  • 111
  • 153
3
votes
2 answers

Error when compiling twitterbootstrap buttons.less on WinLess

I get an 'eval' is null or not object on WinLess on buttons.less. Anyone ? ps. I have used the latest version of everything and import variables / mixins the version I used are: WinLess 1.5.3 Less 1.3 Bootstrap 2.04 Edit: This is fixed in Bootstrap…
maxisam
  • 21,975
  • 9
  • 75
  • 84
3
votes
2 answers

Using a LESS variable as a property instead of a value

I've made the following two Mixins: .responsive_color(@color, @response_color, @speed: 0.1s){ color: @color; .transition(color, @speed); &:hover, &:active, &:focus{ color: @response_color; …
3
votes
3 answers

LESS CSS and escaping Liquid syntax for shopify theme development

I'm creating a Shopify theme and I'm using LESS to compile the stylesheet that Shopify needs as a style.css.liquid. It was all working fine util i started to add in lquid filters and if statements. I have the Liquid syntax working when it's in a css…
Chris Mousdale
  • 505
  • 1
  • 9
  • 21
1 2 3
99
100