-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.less
90 lines (88 loc) · 2.09 KB
/
index.less
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
.addColor(@name, @color, @contrast: false) {
@list: ~'',
~'--hover:hover',
~'--focus:focus';
.generate-classes(@i: length(@list)) when (@i > 0) {
.generate-classes(@i - 1);
@prefix: extract(@list, @i);
.addContrast() when not (@contrast=false) {
color: @contrast;
}
.@{name}@{prefix} {
.addContrast();
background-color: @color;
}
.@{name}-contrast@{prefix} {
.addContrast()
}
.@{name}-text@{prefix} {
color: @color;
}
.@{name}-bg@{prefix} {
background-color: @color;
}
.@{name}-ba@{prefix} {
border-color: @color;
}
.@{name}-bt@{prefix} {
border-top-color: @color;
}
.@{name}-br@{prefix} {
border-right-color: @color;
}
.@{name}-bb@{prefix} {
border-bottom-color: @color;
}
.@{name}-bl@{prefix} {
border-left-color: @color;
}
.@{name}-o@{prefix} {
outline-color: @color;
}
.@{name}-f@{prefix} {
fill: @color;
}
.@{name}-s@{prefix} {
stroke: @color;
}
}
.generate-classes()
}
.addTextColor(@name, @color, @contrast: false) {
@list: ~'',
~'--hover:hover',
~'--focus:focus';
.generate-classes(@i: length(@list)) when (@i > 0) {
.generate-classes(@i - 1);
@prefix: extract(@list, @i);
.@{name}-text@{prefix} {
color: @color;
}
}
.generate-classes()
}
.addBorderColor(@name, @color, @contrast: false) {
@list: ~'',
~'--hover:hover',
~'--focus:focus';
.generate-classes(@i: length(@list)) when (@i > 0) {
.generate-classes(@i - 1);
@prefix: extract(@list, @i);
.@{name}-b@{prefix} {
border-color: @color;
}
.@{name}-bt@{prefix} {
border-top-color: @color;
}
.@{name}-br@{prefix} {
border-right-color: @color;
}
.@{name}-bb@{prefix} {
border-bottom-color: @color;
}
.@{name}-bl@{prefix} {
border-left-color: @color;
}
}
.generate-classes()
}