Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use a `variables.less` file?

I have been using Bootstrap in my website development for some time but I've never had to use a variables.less file on a project.

I now have the main bootstrap.css and a variables.less file that I've customised.

What do I do now, to make the variables.less file have effect?

Thanks

like image 434
user3973427 Avatar asked Sep 30 '14 12:09

user3973427


People also ask

Should I use variables in my less files?

For example, I like to set up a single LESS file that is just my variables, which includes font sizes, colors, headers, etc. When you use your variables in your LESS files, they compile to be perfectly clean CSS. Let’s take a look.

How do you name a variable in less?

Just remember to write your LESS files names as .less and not .css. Variables in LESS begin with the @ sign. What follows that can be any combination of letters and numbers, dashes and underscores. Once you’ve named your variable, follow with a colon (similar to CSS) and define the variable.

What are variables in LESS CSS?

Less CSS allows variables to store css value and then use the variable instead of the value. Less variable define css properties. We can use variable in another css class.

How to modify less variables at run-time?

Enables run-time modification of Less variables. When called with new values, the Less file is recompiled without reloading. Simple basic usage: It is possible to output rules in your CSS which allow tools to locate the source of the rule. Either specify the option dumpLineNumbers as above or add !dumpLineNumbers:mediaquery to the url.


Video Answer


1 Answers

You need to compile your less files. Read more on http://lesscss.org/

like image 123
Ruskin Avatar answered Sep 19 '22 08:09

Ruskin