UNPKG

1.72 kBSCSSView Raw
1@import "restyle";
2
3.is-selector {
4 $tests: (
5 ".test": true,
6 "#test": true,
7 "%test": false,
8 "test": false,
9 "& test": true,
10 "> test": true,
11 "test a": true,
12 "test{foo}": false
13 );
14
15 @each $test, $expected in $tests {
16 $actual: -restyle--is-selector($test);
17 /* [#{if($actual == $expected, PASS, FAIL)}] -restyle--is-selector(#{$test}): #{$actual} */
18 $actual: -restyle--is-selector-js($test);
19 /* [#{if($actual == $expected, PASS, FAIL)}] -restyle--is-selector-js(#{$test}): #{$actual} */
20 }
21
22}
23
24.get-directive {
25 $tests: (
26 "@restyle.foo": foo,
27 "foo": false,
28 "restyle-foo": foo
29 );
30
31 @each $test, $expected in $tests {
32 $actual: -restyle--get-directive($test);
33 /* [#{if($actual == $expected, PASS, FAIL)}] -restyle--get-directive(#{$test}): #{$actual} */
34 $actual: -restyle--get-directive-js($test);
35 /* [#{if($actual == $expected, PASS, FAIL)}] -restyle--get-directive-js(#{$test}): #{$actual} */
36 }
37}
38
39.normalize-property {
40 $tests: (
41 test\foo: test,
42 "test{foo}": test,
43 test-foo: test-foo,
44 "test": test
45 );
46
47 @each $test, $expected in $tests {
48 $actual: -restyle--normalize-property($test);
49 /* [#{if($actual == $expected, PASS, FAIL)}] -restyle--normalize-property(#{$test}): #{$actual} */
50 $actual: -restyle--normalize-property-js($test);
51 /* [#{if($actual == $expected, PASS, FAIL)}] -restyle--normalize-property-js(#{$test}): #{$actual} */
52 }
53}
54
55.normalize-word {
56 $tests: (
57 yellow: unquote('yellow')
58 );
59
60 @each $test, $expected in $tests {
61 $actual: -restyle--normalize-word-js($test);
62 /* [#{if($actual == $expected, PASS, FAIL)}] -restyle--normalize-word-js(#{$test}): #{$actual} */
63 }
64}