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
37
votes
2 answers

lessc binary not available after installing less via NPM

I went ahead and installed and tested node.js and then I installed LESS CSS via NPM but when I type in the command lessc styles.less or lessc styles.less > styles.css It tells me -bash: lessc: command not found I'm in MAC Lion Terminal…
Chris
  • 823
  • 2
  • 7
  • 16
37
votes
1 answer

Less Immediate Parent Selector

Less allows one to select the parent selector (http://lesscss.org/features/#parent-selectors-feature) How does one get the immediate parent selector, not the root parent selector?
CMCDragonkai
  • 6,222
  • 12
  • 56
  • 98
37
votes
6 answers

Styling Twitter's Bootstrap 3.x Buttons

Twitter's Bootstrap 3 buttons are limited in colors. By default there will be 5 7 colors (default primary, error, warning, info, success and link) See: Every button got 3 state (default, active and disabled) How to add more colors or create custom…
Bass Jobsen
  • 48,736
  • 16
  • 143
  • 224
35
votes
13 answers

Is there an online tool to compile LESS?

I'm trying to use LESS in my webpage, but am having trouble compiling it. It's built to work on ruby, which I don't have permission to install on my pc. Is there an online tool for this compilation? I know that lessphp exists, but I can't find the…
Eric
  • 95,302
  • 53
  • 242
  • 374
34
votes
5 answers

Less v2 does not compile Twitter's Bootstrap 2.x

When compiling Twitter's Bootstrap 2.3.2. with Less 2 i found to following error: NameError: #grid > .core > .span is undefined in /home/bootstrap-2.3.2/less/navbar.less on line 199, column 3: 198 .navbar-fixed-bottom .container { 199 #grid >…
Bass Jobsen
  • 48,736
  • 16
  • 143
  • 224
33
votes
3 answers

How to calculate percentages in LESS CSS?

I would like to calculate the width of child-container (div etc) in percentages depending on the parent container with LESS CSS. I am using the forumula by Ethan Marcotte: target / context = result. Parent container: 620px Child container: 140px I…
HappyElephant
  • 333
  • 1
  • 3
  • 6
33
votes
8 answers

webpack error in Cannot find module 'less'

I'm trying to use less loader in webpack and the issues is - I've installed less loader locally, but when I try to compile everything using webpack command in bask, it prints out: "ERROR in Cannot find module 'less'". In my entry point I require…
Alex Buddy
  • 473
  • 1
  • 6
  • 15
33
votes
9 answers

LESS CSS on Windows

Trying to set up LESS for CSS on my Windows box, I've installed ruby and rubygems and followed the instructions exactly. I have put teststyle.less in C:\. When I type lessc teststyle.less to compile it into a .css file, I get an error: The…
Mojave Storm
  • 571
  • 2
  • 7
  • 18
33
votes
7 answers

CSS - Add Color with a data attribute - attr(data-color color)

I'm trying to add color to different element with a data attribute in my css but doensn't work ... I follow this instructions : The attr() Function: Properties Values Collected from the Edited Document. W3C HTML
Zagloo
  • 1,297
  • 4
  • 17
  • 34
33
votes
17 answers

Bootstrap Icons not showing in published ASP.NET MVC application

--- NB: Go to the EDITED 2 section for summary ---- I have an ASP.NT MVC (4) application. I integrated (twitter)Bootstrap to it. Bootstrap is working perfectly, but the icons does not show correctly when I publish the application. I tried to…
sabotero
  • 4,265
  • 3
  • 28
  • 43
33
votes
5 answers

Fluid Container in Bootstrap 3

How to make fluid container in bootstrap 3? In bootstrap 2.3.2 .container-fluid class is there. But now in bootstrap 3 it is missing and there is only .container class. Please help me.
Hari Krishnan
  • 813
  • 2
  • 9
  • 14
33
votes
4 answers

CSS Specificity Filter

This is a long shot, but is there a tool available that optimizes CSS selectors by removing unneeded specificity? I find that when I write CSS, I deliberately make my selectors more specific than necessary to avoid conflicts and for…
cantera
  • 24,479
  • 25
  • 95
  • 138
32
votes
7 answers

How to configure Next.js with Antd / Less and Sass / CSS modules

I want to use Next.js with Sass and CSS modules but also want to use Ant Design and wanted to use the Less styles for smaller building size. I'm able to enable either CSS modules or Less loader but not both at the same time. The examples from…
JustTB
  • 819
  • 1
  • 8
  • 11
32
votes
2 answers

Less mixin with optional parameters

I have a Less mixin defined as: .fontStyle(@family, @size, @weight: normal, @style: normal, @color: #ffffff, @letter-spacing: normal) { font-family: @family; font-size: @size; color: @color; font-weight: @weight; font-style: @style; …
Justin
  • 42,716
  • 77
  • 201
  • 296
31
votes
3 answers

Less css file include in section

Which files are needed to include in section for less css. At less official site , i have just seen that they have told to include .less and .js file. But it is not working without .css file.
Moue Mita
  • 321
  • 1
  • 3
  • 6