UNPKG

1.46 kBSCSSView Raw
1@import "restyle";
2
3@include restyle-define(alias-me, (
4 aliased: true
5));
6
7@include restyle-define(test, (
8 color: green,
9 height: 100%,
10
11 // modifiers...
12 "@restyle.modifiers": (
13 modified: (
14 color: red
15 ),
16 alt: (
17 width: 100%
18 ),
19 aliased: (
20 '@restyle.alias': alias-me
21 ),
22 extended: (
23 '@restyle.extends': modified
24 ),
25 extended-alt: (
26 '@restyle.extends': alt modified
27 ),
28 extended-alias: (
29 '@restyle.extends': aliased
30 )
31 )
32));
33
34.test {
35 @include restyle(test);
36}
37
38.test2a {
39 @include restyle(modified test);
40}
41
42.test2b {
43 @include restyle(extended test);
44}
45
46.test3a {
47 @include restyle(alias-me);
48}
49
50.test3b {
51 @include restyle(aliased test);
52}
53
54.test3c {
55 @include restyle(extended-alias test);
56}
57
58.test4 {
59 @include restyle(extended-alt test);
60}
61
62
63
64// TODO - move to separate test
65@function bg-color($color) {
66 @return (
67 background-color: $color
68 );
69}
70
71@include restyle-define(test-special-props, (
72 '@restyle.var foo': red,
73 color: '@var.foo',
74
75 // modifiers...
76 "@restyle.modifiers": (
77 modified: (
78 '@restyle.function bg-color': (orange, ),
79 '@restyle.var foo': green
80 ),
81 extended: (
82 '@restyle.extends': modified
83 )
84 )
85));
86
87.test-special-props {
88 @include restyle(test-special-props);
89 &.modified {
90 @include restyle(modified test-special-props);
91 }
92 &.extended {
93 @include restyle(extended test-special-props);
94 }
95}