-
Book Overview & Buying
-
Table Of Contents
Less Web Development Essentials (Second Edition)
By :
Less is an extension of CSS. This means that Less gives an error when you try to compile a CSS syntax that is not valid or uses a proprietary syntax, which Less doesn't recognize. Note that Less only checks the syntax and does not check whether the assigned value makes sense. The following code assigns a color to the width property:
p {
width: darkblue;
}Although the CSS syntax for the width property only allows auto | value | initial | inherit, with value the width value in px, cm, em, and so on, or a percentage assigned. Less also compiles the invalid color value.
Some browsers define properties with an invalid CSS code. Well-known examples will include some properties, such as property: ms:somefunction(). Some of these rules can be replaced by vendor-specific rules. It is important to note that the invalid property values won't get compiled in Less. To compile the property: ms:somefunction() value in your CSS code, you can use the following Less code:
selector...
Change the font size
Change margin width
Change background colour