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_mixin(self): | |
12 src = """ | |
13 @mixin font { | |
14 font: { | |
15 weight: inherit; | |
16 style: inherit; | |
17 size: 100%; | |
18 family: inherit; }; | |
19 vertical-align: baseline; } | |
20 | |
21 @mixin global { | |
22 .global { | |
23 border:red; | |
24 @include font; | |
25 } | |
26 } | |
27 | |
28 @include global; | |
29 | |
30 @mixin rounded-top( $radius:10px ) { | |
31 $side: top; | |
32 border-#{$side}-radius: $radius; | |
33 -moz-border-radius-#{$side}: $radius; | |
34 -webkit-border-#{$side}-radius: $radius; | |
35 } | |
36 #navbar li { @include rounded-top; } | |
37 #footer { @include rounded-top(5px); } | |
38 """ | |
39 test = ".global{border:#f00;vertical-align:baseline;font-weight:inherit;
font-style:inherit;font-size:100%;font-family:inherit}#navbar li{border-top-radi
us:10px;-moz-border-radius-top:10px;-webkit-border-top-radius:10px}#footer{borde
r-top-radius:5px;-moz-border-radius-top:5px;-webkit-border-top-radius:5px}" | |
40 out = self.parser.loads(src) | |
41 self.assertEqual(test, out) | |
OLD | NEW |