File: mixins-pattern.less

package info (click to toggle)
less.js 1.6.3~dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,220 kB
  • ctags: 1,015
  • sloc: sh: 122; makefile: 63; perl: 11
file content (99 lines) | stat: -rw-r--r-- 1,061 bytes parent folder | download | duplicates (5)
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
91
92
93
94
95
96
97
98
99
.mixin (...) {
  variadic: true;
}
.mixin () {
    zero: 0;
}
.mixin (@a: 1px) {
    one: 1;
}
.mixin (@a) {
    one-req: 1;
}
.mixin (@a: 1px, @b: 2px) {
    two: 2;
}

.mixin (@a, @b, @c) {
    three-req: 3;
}

.mixin (@a: 1px, @b: 2px, @c: 3px) {
    three: 3;
}

.zero {
    .mixin();
}

.one {
    .mixin(1);
}

.two {
    .mixin(1, 2);
}

.three {
    .mixin(1, 2, 3);
}

//

.mixout ('left') {
    left: 1;
}

.mixout ('right') {
    right: 1;
}

.left {
    .mixout('left');
}
.right {
    .mixout('right');
}

//

.border (@side, @width) {
    color: black;
    .border-side(@side, @width);
}
.border-side (left, @w) {
    border-left: @w;
}
.border-side (right, @w) {
    border-right: @w;
}

.border-right {
    .border(right, 4px);
}
.border-left {
    .border(left, 4px);
}

//


.border-radius (@r) {
    both: (@r * 10);
}
.border-radius (@r, left) {
    left: @r;
}
.border-radius (@r, right) {
    right: @r;
}

.only-right {
    .border-radius(33, right);
}
.only-left {
    .border-radius(33, left);
}
.left-right {
    .border-radius(33);
}