UNPKG

1.43 kBSCSSView Raw
1@import "restyle";
2
3// define our UI element...
4@include restyle-define(test, (
5 restyle-modifiers: (
6 // we CAN extend private within the same defn
7 extends: (
8 restyle-extends: private,
9 extends: true
10 ),
11 // we CAN alias private within the same defn
12 aliases: (
13 restyle-alias: private this
14 ),
15 // we CAN alias external public modifiers
16 external-extends: (
17 restyle-alias: extends test2
18 ),
19 // we CANNOT alias external private modifiers
20 external-private: (
21 restyle-alias: private test2
22 ),
23 // we CANNOT reference private directly
24 restyle-private(private): (
25 private: true
26 )
27 )
28));
29
30@include restyle-define(test2, (
31 restyle-modifiers: (
32 extends: (
33 restyle-extends: private,
34 external-extends: true
35 ),
36 restyle-private(private): (
37 external-private: true
38 )
39 )
40));
41
42.test {
43 @include restyle(test);
44 &.extends {
45 @include restyle(extends test);
46 }
47 &.aliases {
48 @include restyle(aliases test);
49 }
50 // we cannot reference private directly
51 &.private {
52 @include restyle(private test);
53 }
54 // ensure that `restyle-private(...)` does not allow us to bypass the restriction
55 &.private-fn {
56 @include restyle(restyle-private(private) test);
57 }
58
59 &.external-extends {
60 @include restyle(external-extends test);
61 }
62 &.external-private {
63 @include restyle(external-private test);
64 }
65}