plugin.less
1.93 KB
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
// 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 "./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 "./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 {
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 {
result : test-global();
}
}
}
.test {
@media screen {
@plugin "./plugin/plugin-local";
result : test-local();
}
}