OLD | NEW |
| (Empty) |
1 import unittest | |
2 | |
3 from scss.parser import Stylesheet | |
4 | |
5 | |
6 class TestSCSS( unittest.TestCase ): | |
7 | |
8 def setUp(self): | |
9 self.parser = Stylesheet(options=dict(compress=True)) | |
10 | |
11 def test_variables(self): | |
12 src = """ | |
13 @vars { | |
14 $blue: #ffdd00 !default; | |
15 $test: rgb(120, 35, 64); | |
16 $test2: rgba(120, 35, 64, .4); | |
17 $property: float; | |
18 $value: left; | |
19 $len: 0px or 5px; | |
20 } | |
21 $margin: 16px; | |
22 $side: top; | |
23 $image: 'test.png'; | |
24 | |
25 .content-navigation { | |
26 #{$property}: #{$value}; | |
27 border-color: $blue; | |
28 background-color: $test + 5%; | |
29 | |
30 | |
31 background-image: url('/test/' + $image); | |
32 display: -moz-inline-box; | |
33 color: $blue - 9%; | |
34 margin: $len (-$margin * 2 ) -12px; | |
35 } | |
36 | |
37 .border { | |
38 padding-#{$side}: $margin / 2; | |
39 margin: $margin / 2; | |
40 padding-left: -$margin + 2px; | |
41 border-#{$side}: { | |
42 color: $blue; | |
43 } | |
44 color: $test2; | |
45 font: -1.5em + 50px; | |
46 } | |
47 """ | |
48 test = ".content-navigation{float:left;display:-moz-inline-box;margin:5p
x -32px -12px;border-color:#fd0;background-color:#7b1f3e;background-image:url(/t
est/test.png);color:#f3d40b}.border{margin:8px;padding-top:8px;padding-left:-14p
x;border-top-color:#fd0;color:rgba(120,35,64,0.40);font:30.5px}" | |
49 out = self.parser.loads(src) | |
50 self.assertEqual(test, out) | |
OLD | NEW |