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
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.
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.
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.
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.
You need to compile your less files. Read more on http://lesscss.org/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With