OSDN Git Service

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