-
Notifications
You must be signed in to change notification settings - Fork 3.4k
/
plugin.less
142 lines (128 loc) · 3.35 KB
/
plugin.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// importing plugin globally
@plugin "plugin/plugin-global";
// transitively include plugins from importing another sheet
@import "./plugin/plugin-transitive";
// `test-global` function should be reachable
// `test-local` function should not be reachable
// `test-shadow` function should return global version
.class {
trans : test-transitive();
global : test-global();
local : test-local();
shadow : test-shadow();
// `test-global` function should propagate and be reachable
// `test-local` function should be reachable
// `test-shadow` function should return local version, shadowing global version
.local {
@plugin (option) "./plugin/plugin-local";
global : test-global();
local : test-local();
shadow : test-shadow();
}
}
// calling a mixin or detached ruleset should not bubble local plugins
// imported inside either into the parent scope.
.mixin() {
@plugin "./plugin/plugin-local";
mixin-local : test-local();
mixin-global : test-global();
mixin-shadow : test-shadow();
}
@ruleset : {
@plugin "./plugin/plugin-local";
ruleset-local : test-local();
ruleset-global : test-global();
ruleset-shadow : test-shadow();
};
#ns {
@plugin (test=test) "./plugin/plugin-local";
.mixin() {
ns-mixin-global : test-global();
ns-mixin-local : test-local();
ns-mixin-shadow : test-shadow();
}
}
.class {
#ns > .mixin();
.mixin();
@ruleset();
class-local : test-local();
}
// `test-global` function should propagate into directive scope
@media screen {
.test-rule {
result : test-global();
}
}
@font-face {
result : test-global();
}
// `test-global` function should propagate into nested directive scopes
@media screen and (min-width:100px) {
@media (max-width:400px) {
.test-rule {
result : test-global();
}
}
}
.test-rule {
@media screen {
@plugin "./plugin/plugin-local";
result : test-local();
}
}
@plugin "./plugin/plugin-tree-nodes";
@ruleset2: test-detached-ruleset();
.root {
@ruleset2();
}
.test-rule-empty {
val1: foo;
test-collapse();
val2: foo;
}
.test-rule-simple {
@plugin "./plugin/plugin-simple";
value: pi-anon();
value: (pi() * 2);
}
.test-rule-conflicts {
@plugin "./plugin/plugin-scope1";
value: foo();
}
.test-rule-conflicts {
@plugin "./plugin/plugin-scope2";
value: foo();
}
.test-rule-conflicts {
@plugin "./plugin/plugin-scope1";
value: foo();
}
.test-rule-collection {
@plugin "./plugin/plugin-collection";
@var: 32;
store(@var);
store(5);
store("bird");
list: list();
}
test-atrule("@charset"; '"utf-8"');
test-atrule("@arbitrary"; "value after ()");
// no minVersion specified
@plugin (option1) "./plugin/plugin-set-options";
@plugin "./plugin/plugin-set-options";
@plugin (option2) "./plugin/plugin-set-options";
@plugin "./plugin/plugin-set-options";
@plugin (option3) "./plugin/plugin-set-options";
// specifies minVersion: [2,0,0]
@plugin (option1) "./plugin/plugin-set-options-v2";
@plugin "./plugin/plugin-set-options-v2";
@plugin (option2) "./plugin/plugin-set-options-v2";
@plugin "./plugin/plugin-set-options-v2";
@plugin (option3) "./plugin/plugin-set-options-v2";
// specifies minVersion: [3,0,0]
@plugin (option1) "./plugin/plugin-set-options-v3";
@plugin "./plugin/plugin-set-options-v3";
@plugin (option2) "./plugin/plugin-set-options-v3";
@plugin "./plugin/plugin-set-options-v3";
@plugin (option3) "./plugin/plugin-set-options-v3";