OSDN Git Service

Regular updates
[twpd/master.git] / less.md
1 ---
2 title: Less.js
3 ---
4
5 ### Functions
6
7     unit(30px / 5px)  #=> 6
8     unit(5, px)       #=> 5px
9
10     e("ms:stuff()")   #=> ms:stuff() (unquote)
11
12     %("count: %d", 1+2) #=> "count: 3"
13
14     iscolor(@x)
15     isstring(@x)
16     isnumber(@x)
17     iskeyword(@x)
18     isurl(url(...))
19     ispixel()
20     isem()
21     ispercentage()
22     isunit()
23
24     hue(@color)
25     saturation(@color)
26     lightness(@color)
27     luma(@color)
28     luminance(@color)
29
30     fade(@color, amount)
31     fadein(@color, amount)
32     fadeout(@color, amount)
33     spin(@color, degrees)
34     mix(@a, @b, amount)
35
36 ### Conditionals
37
38     .image when (luma(@color) > 50%) { }
39     .image when (not(...)) { }
40     .image when (default()) {}
41     .image when (e(@shape) = 'circle') { }
42