The Less Type functions are used to determine the type of the value.
A list of Type functions used in Less:
Index |
Type |
Description |
Example |
1) |
It accepts a value as parameter and returns true, if it's a
number otherwise returns false. |
isnumber(1234); // true |
|
2) |
It accepts a value as parameter and returns true, if it's a
string otherwise returns false. |
isstring("variable"); // true |
|
3) |
It accepts a value as parameter and returns true, if value is
a color otherwise returns false. |
iscolor(#fff); // true |
|
4) |
It accepts a value as parameter and returns true, if value is
a keyword otherwise returns false. |
iskeyword(keyword); // true |
|
5) |
It accepts a value as parameter and returns true, if value is
a url otherwise returns false. |
isurl(url(...)); // true |
|
6) |
It accepts a value as parameter and returns true, if value is
a number in pixels otherwise returns false. |
ispixel(24px); // true |
|
7) |
It accepts a value as parameter and returns true, if value is
an em value otherwise returns false. |
isem(0.5em); // true |
|
8) |
It accepts a value as parameter and returns true, if value is
in percentage otherwise returns false. |
ispercentage(7.5%); // true |
|
9) |
It displays true if a value is a number in specified units
provided as parameter otherwise false if value is not a number in specified
units. |
isunit(10px, px); // true |
|
10) |
It accepts a value as parameter and returns true, if value is
a ruleset otherwise returns false. |
@rules: {<div> color: green;<div>} |
0 Comments