Intro to LESS CSS – Part 2

Operations:- Operations are functions or modifiers that we can apply to our rules. We can Add, Substract, Multiply or Divide.

Note:- LESS is aware of PX hence no need to mention measurement unit.

Color Functions:- Color functions are used to make variations in color. These functions are darken, lighten, fadein, fadeout, saturate, desaturate. Fadein and fadeout need opacity to be mentioned already.

Comments:- There are two ways in which we can comment.

/*This will appear in LESS to CSS file*/

//This will not appear in CSS file.

Importing:- When we mention file name we can mention .LESS or .CSS extention for the file that we are importing

E.G:- @Import “reset”

Escaping:- Old proprietory code causes LESS to error, hence we can escape using ~”-code-”

E.G:- filter: ~”progid:DXImageTransform.Microsoft.gradient(startColorstr=#fad59f, endColorstr=#fa9907)”

Scope:- Variables will inherit first from local scope, if not available locally it will search for wider scope

Spin:- We can use spin method to spin the color wheel by degrees to change color values. Its best to set only one color variable in LESS stylesheet and use modifiers throughout rest, then whole design depends on it.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s