sass 3.2.0.alpha.64 → 3.2.0.alpha.70
Sign up to get free protection for your applications and to get access to all the features.
- data/REVISION +1 -1
- data/VERSION +1 -1
- data/lib/sass/css.rb +2 -0
- data/lib/sass/engine.rb +1 -1
- data/lib/sass/exec.rb +24 -3
- data/lib/sass/plugin/staleness_checker.rb +14 -4
- data/lib/sass/repl.rb +2 -2
- data/lib/sass/script/color.rb +150 -19
- data/lib/sass/script/functions.rb +36 -7
- data/lib/sass/script/parser.rb +1 -1
- data/lib/sass/scss/parser.rb +1 -1
- data/lib/sass/tree/visitors/convert.rb +4 -2
- data/lib/sass/tree/visitors/deep_copy.rb +1 -1
- data/lib/sass/tree/visitors/perform.rb +3 -1
- data/test/sass/conversion_test.rb +321 -95
- data/test/sass/engine_test.rb +7 -0
- data/test/sass/extend_test.rb +14 -0
- data/test/sass/functions_test.rb +13 -3
- data/test/sass/less_conversion_test.rb +162 -79
- data/test/sass/plugin_test.rb +24 -0
- data/test/sass/templates/_double_import_loop2.sass +1 -0
- data/test/sass/templates/double_import_loop1.sass +1 -0
- data/test/sass/templates/single_import_loop.sass +1 -0
- data/vendor/fssm/ext/rakefile.rb +14 -0
- data/vendor/fssm/fssm.gemspec +3 -0
- data/vendor/fssm/lib/fssm.rb +57 -20
- data/vendor/fssm/lib/fssm/support.rb +20 -25
- data/vendor/fssm/lib/fssm/version.rb +1 -1
- metadata +12 -8
@@ -10,7 +10,8 @@ foo bar
|
|
10
10
|
SASS
|
11
11
|
foo bar {
|
12
12
|
baz: bang;
|
13
|
-
bip: bop;
|
13
|
+
bip: bop;
|
14
|
+
}
|
14
15
|
SCSS
|
15
16
|
assert_renders <<SASS, <<SCSS, :old => true
|
16
17
|
foo bar
|
@@ -19,7 +20,8 @@ foo bar
|
|
19
20
|
SASS
|
20
21
|
foo bar {
|
21
22
|
baz: bang;
|
22
|
-
bip: bop;
|
23
|
+
bip: bop;
|
24
|
+
}
|
23
25
|
SCSS
|
24
26
|
end
|
25
27
|
|
@@ -47,8 +49,10 @@ SASS
|
|
47
49
|
foo bar {
|
48
50
|
baz bang {
|
49
51
|
baz: bang;
|
50
|
-
bip: bop;
|
51
|
-
|
52
|
+
bip: bop;
|
53
|
+
}
|
54
|
+
blat: boo;
|
55
|
+
}
|
52
56
|
SCSS
|
53
57
|
end
|
54
58
|
|
@@ -60,7 +64,9 @@ foo bar
|
|
60
64
|
SASS
|
61
65
|
foo bar {
|
62
66
|
&:hover {
|
63
|
-
baz: bang;
|
67
|
+
baz: bang;
|
68
|
+
}
|
69
|
+
}
|
64
70
|
SCSS
|
65
71
|
end
|
66
72
|
|
@@ -70,7 +76,8 @@ foo \#{$bar + "baz"}.bip
|
|
70
76
|
baz: bang
|
71
77
|
SASS
|
72
78
|
foo \#{$bar + "baz"}.bip {
|
73
|
-
baz: bang;
|
79
|
+
baz: bang;
|
80
|
+
}
|
74
81
|
SCSS
|
75
82
|
end
|
76
83
|
|
@@ -82,7 +89,8 @@ baz bang
|
|
82
89
|
SASS
|
83
90
|
foo bar,
|
84
91
|
baz bang {
|
85
|
-
baz: bang;
|
92
|
+
baz: bang;
|
93
|
+
}
|
86
94
|
SCSS
|
87
95
|
|
88
96
|
assert_renders <<SASS, <<SCSS
|
@@ -94,7 +102,9 @@ SASS
|
|
94
102
|
blat {
|
95
103
|
foo bar,
|
96
104
|
baz bang {
|
97
|
-
baz: bang;
|
105
|
+
baz: bang;
|
106
|
+
}
|
107
|
+
}
|
98
108
|
SCSS
|
99
109
|
end
|
100
110
|
|
@@ -105,13 +115,15 @@ foo bar baz bang
|
|
105
115
|
SASS
|
106
116
|
foo bar
|
107
117
|
baz bang {
|
108
|
-
baz: bang;
|
118
|
+
baz: bang;
|
119
|
+
}
|
109
120
|
SCSS
|
110
121
|
|
111
122
|
assert_scss_to_scss <<SCSS
|
112
123
|
foo bar
|
113
124
|
baz bang {
|
114
|
-
baz: bang;
|
125
|
+
baz: bang;
|
126
|
+
}
|
115
127
|
SCSS
|
116
128
|
end
|
117
129
|
|
@@ -123,7 +135,9 @@ foo bar
|
|
123
135
|
SASS
|
124
136
|
foo bar {
|
125
137
|
:hover {
|
126
|
-
baz: bang;
|
138
|
+
baz: bang;
|
139
|
+
}
|
140
|
+
}
|
127
141
|
SCSS
|
128
142
|
end
|
129
143
|
|
@@ -133,7 +147,8 @@ foo bar
|
|
133
147
|
baz\#{$bang}bip\#{$bop}: 12
|
134
148
|
SASS
|
135
149
|
foo bar {
|
136
|
-
baz\#{$bang}bip\#{$bop}: 12;
|
150
|
+
baz\#{$bang}bip\#{$bop}: 12;
|
151
|
+
}
|
137
152
|
SCSS
|
138
153
|
end
|
139
154
|
|
@@ -143,7 +158,8 @@ foo bar
|
|
143
158
|
baz\#{$bang}bip\#{$bop}: 12
|
144
159
|
SASS
|
145
160
|
foo bar {
|
146
|
-
baz\#{$bang}bip\#{$bop}: 12;
|
161
|
+
baz\#{$bang}bip\#{$bop}: 12;
|
162
|
+
}
|
147
163
|
SCSS
|
148
164
|
end
|
149
165
|
|
@@ -153,7 +169,8 @@ foo bar
|
|
153
169
|
baz: 12 \#{$bang} bip \#{"bop"} blat
|
154
170
|
SASS
|
155
171
|
foo bar {
|
156
|
-
baz: 12 \#{$bang} bip \#{"bop"} blat;
|
172
|
+
baz: 12 \#{$bang} bip \#{"bop"} blat;
|
173
|
+
}
|
157
174
|
SCSS
|
158
175
|
end
|
159
176
|
|
@@ -163,7 +180,8 @@ foo bar
|
|
163
180
|
baz: 12 $bang "bip"
|
164
181
|
SASS
|
165
182
|
foo bar {
|
166
|
-
baz: 12 $bang "bip";
|
183
|
+
baz: 12 $bang "bip";
|
184
|
+
}
|
167
185
|
SCSS
|
168
186
|
end
|
169
187
|
|
@@ -173,7 +191,8 @@ foo bar
|
|
173
191
|
:baz 12 $bang "bip"
|
174
192
|
SASS
|
175
193
|
foo bar {
|
176
|
-
baz: 12 $bang "bip";
|
194
|
+
baz: 12 $bang "bip";
|
195
|
+
}
|
177
196
|
SCSS
|
178
197
|
end
|
179
198
|
|
@@ -186,18 +205,21 @@ foo bar {
|
|
186
205
|
baz:
|
187
206
|
bip
|
188
207
|
bam
|
189
|
-
boon;
|
208
|
+
boon;
|
209
|
+
}
|
190
210
|
SCSS
|
191
211
|
|
192
212
|
assert_scss_to_scss <<OUT, <<IN
|
193
213
|
foo bar {
|
194
|
-
baz: bip bam boon;
|
214
|
+
baz: bip bam boon;
|
215
|
+
}
|
195
216
|
OUT
|
196
217
|
foo bar {
|
197
218
|
baz:
|
198
219
|
bip
|
199
220
|
bam
|
200
|
-
boon;
|
221
|
+
boon;
|
222
|
+
}
|
201
223
|
IN
|
202
224
|
end
|
203
225
|
|
@@ -210,18 +232,21 @@ foo bar {
|
|
210
232
|
baz:
|
211
233
|
$bip
|
212
234
|
"bam"
|
213
|
-
12px;
|
235
|
+
12px;
|
236
|
+
}
|
214
237
|
SCSS
|
215
238
|
|
216
239
|
assert_scss_to_scss <<OUT, <<IN
|
217
240
|
foo bar {
|
218
|
-
baz: $bip "bam" 12px;
|
241
|
+
baz: $bip "bam" 12px;
|
242
|
+
}
|
219
243
|
OUT
|
220
244
|
foo bar {
|
221
245
|
baz:
|
222
246
|
$bip
|
223
247
|
"bam"
|
224
|
-
12px;
|
248
|
+
12px;
|
249
|
+
}
|
225
250
|
IN
|
226
251
|
end
|
227
252
|
|
@@ -243,7 +268,8 @@ SASS
|
|
243
268
|
// baz
|
244
269
|
|
245
270
|
foo bar {
|
246
|
-
a: b;
|
271
|
+
a: b;
|
272
|
+
}
|
247
273
|
SCSS
|
248
274
|
|
249
275
|
assert_renders <<SASS, <<SCSS
|
@@ -261,7 +287,8 @@ SASS
|
|
261
287
|
// bang
|
262
288
|
|
263
289
|
foo bar {
|
264
|
-
a: b;
|
290
|
+
a: b;
|
291
|
+
}
|
265
292
|
SCSS
|
266
293
|
|
267
294
|
assert_sass_to_scss <<SCSS, <<SASS
|
@@ -271,7 +298,8 @@ SCSS
|
|
271
298
|
// bang
|
272
299
|
|
273
300
|
foo bar {
|
274
|
-
a: b;
|
301
|
+
a: b;
|
302
|
+
}
|
275
303
|
SCSS
|
276
304
|
// foo
|
277
305
|
// bar
|
@@ -345,7 +373,8 @@ SASS
|
|
345
373
|
/* baz */
|
346
374
|
|
347
375
|
foo bar {
|
348
|
-
a: b;
|
376
|
+
a: b;
|
377
|
+
}
|
349
378
|
SCSS
|
350
379
|
|
351
380
|
assert_scss_to_sass <<SASS, <<SCSS
|
@@ -363,7 +392,8 @@ SASS
|
|
363
392
|
bang */
|
364
393
|
|
365
394
|
foo bar {
|
366
|
-
a: b;
|
395
|
+
a: b;
|
396
|
+
}
|
367
397
|
SCSS
|
368
398
|
|
369
399
|
assert_scss_to_scss <<SCSS
|
@@ -373,7 +403,8 @@ SCSS
|
|
373
403
|
bang */
|
374
404
|
|
375
405
|
foo bar {
|
376
|
-
a: b;
|
406
|
+
a: b;
|
407
|
+
}
|
377
408
|
SCSS
|
378
409
|
|
379
410
|
assert_renders <<SASS, <<SCSS
|
@@ -391,7 +422,8 @@ SASS
|
|
391
422
|
* bang */
|
392
423
|
|
393
424
|
foo bar {
|
394
|
-
a: b;
|
425
|
+
a: b;
|
426
|
+
}
|
395
427
|
SCSS
|
396
428
|
end
|
397
429
|
|
@@ -411,7 +443,8 @@ foo {
|
|
411
443
|
* beep boop */
|
412
444
|
bang: bizz;
|
413
445
|
/* bubble bubble
|
414
|
-
* toil trouble */
|
446
|
+
* toil trouble */
|
447
|
+
}
|
415
448
|
SCSS
|
416
449
|
|
417
450
|
assert_sass_to_scss <<SCSS, <<SASS
|
@@ -423,7 +456,8 @@ foo {
|
|
423
456
|
bang: bizz;
|
424
457
|
/* bubble bubble
|
425
458
|
* toil trouble
|
426
|
-
* gorp */
|
459
|
+
* gorp */
|
460
|
+
}
|
427
461
|
SCSS
|
428
462
|
foo
|
429
463
|
bar: baz
|
@@ -449,7 +483,8 @@ foo {
|
|
449
483
|
/* foo
|
450
484
|
bar
|
451
485
|
baz */
|
452
|
-
a: b;
|
486
|
+
a: b;
|
487
|
+
}
|
453
488
|
SCSS
|
454
489
|
|
455
490
|
assert_sass_to_scss <<SCSS, <<SASS
|
@@ -457,7 +492,8 @@ foo {
|
|
457
492
|
/* foo
|
458
493
|
* bar
|
459
494
|
* baz */
|
460
|
-
a: b;
|
495
|
+
a: b;
|
496
|
+
}
|
461
497
|
SCSS
|
462
498
|
foo
|
463
499
|
/* foo
|
@@ -479,7 +515,8 @@ SASS
|
|
479
515
|
* Bar
|
480
516
|
* Baz */
|
481
517
|
.foo#bar {
|
482
|
-
a: b;
|
518
|
+
a: b;
|
519
|
+
}
|
483
520
|
SCSS
|
484
521
|
|
485
522
|
assert_renders <<SASS, <<SCSS
|
@@ -493,7 +530,8 @@ SASS
|
|
493
530
|
// Bar
|
494
531
|
// Baz
|
495
532
|
@mixin foo {
|
496
|
-
a: b;
|
533
|
+
a: b;
|
534
|
+
}
|
497
535
|
SCSS
|
498
536
|
end
|
499
537
|
|
@@ -505,7 +543,8 @@ foo
|
|
505
543
|
SASS
|
506
544
|
foo {
|
507
545
|
@debug 12px;
|
508
|
-
bar: baz;
|
546
|
+
bar: baz;
|
547
|
+
}
|
509
548
|
SCSS
|
510
549
|
end
|
511
550
|
|
@@ -517,7 +556,8 @@ foo
|
|
517
556
|
SASS
|
518
557
|
foo {
|
519
558
|
@foo #bar "baz";
|
520
|
-
bar: baz;
|
559
|
+
bar: baz;
|
560
|
+
}
|
521
561
|
SCSS
|
522
562
|
end
|
523
563
|
|
@@ -533,9 +573,11 @@ SASS
|
|
533
573
|
foo {
|
534
574
|
@foo #bar "baz" {
|
535
575
|
a: b;
|
536
|
-
c: d;
|
576
|
+
c: d;
|
577
|
+
}
|
537
578
|
|
538
|
-
bar: baz;
|
579
|
+
bar: baz;
|
580
|
+
}
|
539
581
|
SCSS
|
540
582
|
end
|
541
583
|
|
@@ -554,12 +596,16 @@ SASS
|
|
554
596
|
foo {
|
555
597
|
@foo #bar "baz" {
|
556
598
|
#blat {
|
557
|
-
a: b;
|
599
|
+
a: b;
|
600
|
+
}
|
558
601
|
.bang {
|
559
602
|
c: d;
|
560
|
-
e: f;
|
603
|
+
e: f;
|
604
|
+
}
|
605
|
+
}
|
561
606
|
|
562
|
-
bar: baz;
|
607
|
+
bar: baz;
|
608
|
+
}
|
563
609
|
SCSS
|
564
610
|
end
|
565
611
|
|
@@ -581,13 +627,17 @@ foo {
|
|
581
627
|
@foo #bar "baz" {
|
582
628
|
g: h;
|
583
629
|
#blat {
|
584
|
-
a: b;
|
630
|
+
a: b;
|
631
|
+
}
|
585
632
|
.bang {
|
586
633
|
c: d;
|
587
|
-
e: f;
|
588
|
-
|
634
|
+
e: f;
|
635
|
+
}
|
636
|
+
i: j;
|
637
|
+
}
|
589
638
|
|
590
|
-
bar: baz;
|
639
|
+
bar: baz;
|
640
|
+
}
|
591
641
|
SCSS
|
592
642
|
end
|
593
643
|
|
@@ -610,10 +660,13 @@ foo
|
|
610
660
|
SASS
|
611
661
|
foo {
|
612
662
|
@for $a from $b to $c {
|
613
|
-
a: b;
|
663
|
+
a: b;
|
664
|
+
}
|
614
665
|
@for $c from 1 to 16 {
|
615
666
|
d: e;
|
616
|
-
f: g;
|
667
|
+
f: g;
|
668
|
+
}
|
669
|
+
}
|
617
670
|
SCSS
|
618
671
|
end
|
619
672
|
|
@@ -628,10 +681,13 @@ foo
|
|
628
681
|
SASS
|
629
682
|
foo {
|
630
683
|
@while flaz($a + $b) {
|
631
|
-
a: b;
|
684
|
+
a: b;
|
685
|
+
}
|
632
686
|
@while 1 {
|
633
687
|
d: e;
|
634
|
-
f: g;
|
688
|
+
f: g;
|
689
|
+
}
|
690
|
+
}
|
635
691
|
SCSS
|
636
692
|
end
|
637
693
|
|
@@ -649,13 +705,18 @@ foo
|
|
649
705
|
SASS
|
650
706
|
foo {
|
651
707
|
@if $foo or $bar {
|
652
|
-
a: b;
|
708
|
+
a: b;
|
709
|
+
}
|
653
710
|
@if $baz {
|
654
|
-
d: e;
|
711
|
+
d: e;
|
712
|
+
}
|
655
713
|
@else if $bang {
|
656
|
-
f: g;
|
714
|
+
f: g;
|
715
|
+
}
|
657
716
|
@else {
|
658
|
-
h: i;
|
717
|
+
h: i;
|
718
|
+
}
|
719
|
+
}
|
659
720
|
SCSS
|
660
721
|
end
|
661
722
|
|
@@ -671,11 +732,15 @@ c
|
|
671
732
|
SASS
|
672
733
|
a {
|
673
734
|
@each $number in 1px 2px 3px 4px {
|
674
|
-
b: $number;
|
735
|
+
b: $number;
|
736
|
+
}
|
737
|
+
}
|
675
738
|
|
676
739
|
c {
|
677
740
|
@each $str in foo, bar, baz, bang {
|
678
|
-
d: $str;
|
741
|
+
d: $str;
|
742
|
+
}
|
743
|
+
}
|
679
744
|
SCSS
|
680
745
|
end
|
681
746
|
|
@@ -693,7 +758,8 @@ SASS
|
|
693
758
|
@import url(bar.css);
|
694
759
|
|
695
760
|
foo {
|
696
|
-
bar: baz;
|
761
|
+
bar: baz;
|
762
|
+
}
|
697
763
|
SCSS
|
698
764
|
|
699
765
|
assert_renders <<SASS, <<SCSS
|
@@ -709,7 +775,8 @@ SASS
|
|
709
775
|
@import url(bar.css);
|
710
776
|
|
711
777
|
foo {
|
712
|
-
bar: baz;
|
778
|
+
bar: baz;
|
779
|
+
}
|
713
780
|
SCSS
|
714
781
|
end
|
715
782
|
|
@@ -779,7 +846,19 @@ SCSS
|
|
779
846
|
SASS
|
780
847
|
.foo {
|
781
848
|
@extend .bar;
|
782
|
-
@extend .baz:bang;
|
849
|
+
@extend .baz:bang;
|
850
|
+
}
|
851
|
+
SCSS
|
852
|
+
end
|
853
|
+
|
854
|
+
def test_comma_extendee
|
855
|
+
assert_renders <<SASS, <<SCSS
|
856
|
+
.baz
|
857
|
+
@extend .foo, .bar
|
858
|
+
SASS
|
859
|
+
.baz {
|
860
|
+
@extend .foo, .bar;
|
861
|
+
}
|
783
862
|
SCSS
|
784
863
|
end
|
785
864
|
|
@@ -791,7 +870,9 @@ SCSS
|
|
791
870
|
SASS
|
792
871
|
@mixin foo-bar {
|
793
872
|
baz {
|
794
|
-
a: b;
|
873
|
+
a: b;
|
874
|
+
}
|
875
|
+
}
|
795
876
|
SCSS
|
796
877
|
|
797
878
|
assert_scss_to_sass <<SASS, <<SCSS
|
@@ -801,13 +882,17 @@ SCSS
|
|
801
882
|
SASS
|
802
883
|
@mixin foo-bar() {
|
803
884
|
baz {
|
804
|
-
a: b;
|
885
|
+
a: b;
|
886
|
+
}
|
887
|
+
}
|
805
888
|
SCSS
|
806
889
|
|
807
890
|
assert_sass_to_scss <<SCSS, <<SASS
|
808
891
|
@mixin foo-bar {
|
809
892
|
baz {
|
810
|
-
a: b;
|
893
|
+
a: b;
|
894
|
+
}
|
895
|
+
}
|
811
896
|
SCSS
|
812
897
|
=foo-bar()
|
813
898
|
baz
|
@@ -823,7 +908,9 @@ SASS
|
|
823
908
|
SASS
|
824
909
|
@mixin foo-bar($baz, $bang) {
|
825
910
|
baz {
|
826
|
-
a: $baz $bang;
|
911
|
+
a: $baz $bang;
|
912
|
+
}
|
913
|
+
}
|
827
914
|
SCSS
|
828
915
|
end
|
829
916
|
|
@@ -835,13 +922,17 @@ SCSS
|
|
835
922
|
SASS
|
836
923
|
@mixin foo-bar($baz, $bang: 12px) {
|
837
924
|
baz {
|
838
|
-
a: $baz $bang;
|
925
|
+
a: $baz $bang;
|
926
|
+
}
|
927
|
+
}
|
839
928
|
SCSS
|
840
929
|
|
841
930
|
assert_sass_to_scss <<SCSS, <<SASS
|
842
931
|
@mixin foo-bar($baz, $bang: foo) {
|
843
932
|
baz {
|
844
|
-
a: $baz $bang;
|
933
|
+
a: $baz $bang;
|
934
|
+
}
|
935
|
+
}
|
845
936
|
SCSS
|
846
937
|
=foo-bar($baz, $bang: foo)
|
847
938
|
baz
|
@@ -857,7 +948,8 @@ foo
|
|
857
948
|
SASS
|
858
949
|
foo {
|
859
950
|
@include foo-bar;
|
860
|
-
a: blip;
|
951
|
+
a: blip;
|
952
|
+
}
|
861
953
|
SCSS
|
862
954
|
end
|
863
955
|
|
@@ -869,7 +961,8 @@ foo
|
|
869
961
|
SASS
|
870
962
|
foo {
|
871
963
|
@include foo-bar(12px, "blaz");
|
872
|
-
a: blip;
|
964
|
+
a: blip;
|
965
|
+
}
|
873
966
|
SCSS
|
874
967
|
end
|
875
968
|
|
@@ -883,7 +976,8 @@ SASS
|
|
883
976
|
foo {
|
884
977
|
@include foo-bar(12px, "blaz", $blip: blap, $bloop: blop);
|
885
978
|
@include foo-bar($blip: blap, $bloop: blop);
|
886
|
-
a: blip;
|
979
|
+
a: blip;
|
980
|
+
}
|
887
981
|
SCSS
|
888
982
|
end
|
889
983
|
|
@@ -895,7 +989,8 @@ SCSS
|
|
895
989
|
SASS
|
896
990
|
@function foo() {
|
897
991
|
$var: 1 + 1;
|
898
|
-
@return $var;
|
992
|
+
@return $var;
|
993
|
+
}
|
899
994
|
SCSS
|
900
995
|
end
|
901
996
|
|
@@ -907,7 +1002,9 @@ SCSS
|
|
907
1002
|
SASS
|
908
1003
|
@function foo($var1, $var2) {
|
909
1004
|
@if $var1 {
|
910
|
-
@return $var1 + $var2;
|
1005
|
+
@return $var1 + $var2;
|
1006
|
+
}
|
1007
|
+
}
|
911
1008
|
SCSS
|
912
1009
|
end
|
913
1010
|
|
@@ -919,7 +1016,9 @@ SCSS
|
|
919
1016
|
SASS
|
920
1017
|
@function foo($var1, $var2: foo) {
|
921
1018
|
@if $var1 {
|
922
|
-
@return $var1 + $var2;
|
1019
|
+
@return $var1 + $var2;
|
1020
|
+
}
|
1021
|
+
}
|
923
1022
|
SCSS
|
924
1023
|
end
|
925
1024
|
|
@@ -935,7 +1034,8 @@ $var1: 12px + 15px;
|
|
935
1034
|
|
936
1035
|
foo {
|
937
1036
|
$var2: flaz(#abcdef);
|
938
|
-
val: $var1 $var2;
|
1037
|
+
val: $var1 $var2;
|
1038
|
+
}
|
939
1039
|
SCSS
|
940
1040
|
end
|
941
1041
|
|
@@ -951,7 +1051,8 @@ $var1: 12px + 15px !default;
|
|
951
1051
|
|
952
1052
|
foo {
|
953
1053
|
$var2: flaz(#abcdef) !default;
|
954
|
-
val: $var1 $var2;
|
1054
|
+
val: $var1 $var2;
|
1055
|
+
}
|
955
1056
|
SCSS
|
956
1057
|
end
|
957
1058
|
|
@@ -979,7 +1080,8 @@ foo
|
|
979
1080
|
a: (1px / 2px)
|
980
1081
|
SASS
|
981
1082
|
foo {
|
982
|
-
a: (1px / 2px);
|
1083
|
+
a: (1px / 2px);
|
1084
|
+
}
|
983
1085
|
SCSS
|
984
1086
|
end
|
985
1087
|
|
@@ -993,7 +1095,8 @@ SASS
|
|
993
1095
|
$var: 1px / 2px;
|
994
1096
|
|
995
1097
|
foo {
|
996
|
-
a: $var;
|
1098
|
+
a: $var;
|
1099
|
+
}
|
997
1100
|
SCSS
|
998
1101
|
|
999
1102
|
assert_renders <<SASS, <<SCSS
|
@@ -1005,7 +1108,8 @@ SASS
|
|
1005
1108
|
$var: 1px;
|
1006
1109
|
|
1007
1110
|
foo {
|
1008
|
-
a: $var / 2px;
|
1111
|
+
a: $var / 2px;
|
1112
|
+
}
|
1009
1113
|
SCSS
|
1010
1114
|
|
1011
1115
|
assert_renders <<SASS, <<SCSS
|
@@ -1013,7 +1117,8 @@ foo
|
|
1013
1117
|
a: 1 + 1px / 2px
|
1014
1118
|
SASS
|
1015
1119
|
foo {
|
1016
|
-
a: 1 + 1px / 2px;
|
1120
|
+
a: 1 + 1px / 2px;
|
1121
|
+
}
|
1017
1122
|
SCSS
|
1018
1123
|
end
|
1019
1124
|
|
@@ -1023,7 +1128,8 @@ foo
|
|
1023
1128
|
a: 1px / 2px
|
1024
1129
|
SASS
|
1025
1130
|
foo {
|
1026
|
-
a: 1px / 2px;
|
1131
|
+
a: 1px / 2px;
|
1132
|
+
}
|
1027
1133
|
SCSS
|
1028
1134
|
end
|
1029
1135
|
|
@@ -1037,7 +1143,8 @@ SASS
|
|
1037
1143
|
$baz: 12;
|
1038
1144
|
|
1039
1145
|
@foo bar\#{$baz} qux {
|
1040
|
-
a: b;
|
1146
|
+
a: b;
|
1147
|
+
}
|
1041
1148
|
SCSS
|
1042
1149
|
end
|
1043
1150
|
|
@@ -1051,7 +1158,8 @@ SASS
|
|
1051
1158
|
$baz: 12;
|
1052
1159
|
|
1053
1160
|
@media bar\#{$baz} {
|
1054
|
-
a: b;
|
1161
|
+
a: b;
|
1162
|
+
}
|
1055
1163
|
SCSS
|
1056
1164
|
end
|
1057
1165
|
|
@@ -1071,7 +1179,8 @@ $var: -webkit-min-device-pixel-ratio;
|
|
1071
1179
|
$val: 20;
|
1072
1180
|
|
1073
1181
|
@media $media1 and ($var: $val), only $media2 {
|
1074
|
-
a: b;
|
1182
|
+
a: b;
|
1183
|
+
}
|
1075
1184
|
SCSS
|
1076
1185
|
end
|
1077
1186
|
|
@@ -1095,7 +1204,8 @@ foo {
|
|
1095
1204
|
.name: val;
|
1096
1205
|
name/**/: val;
|
1097
1206
|
name/*\\**/: val;
|
1098
|
-
name: val;
|
1207
|
+
name: val;
|
1208
|
+
}
|
1099
1209
|
SCSS
|
1100
1210
|
end
|
1101
1211
|
|
@@ -1113,7 +1223,8 @@ foo {
|
|
1113
1223
|
*name: val;
|
1114
1224
|
#name: val;
|
1115
1225
|
.name: val;
|
1116
|
-
name: val;
|
1226
|
+
name: val;
|
1227
|
+
}
|
1117
1228
|
SCSS
|
1118
1229
|
end
|
1119
1230
|
|
@@ -1124,7 +1235,8 @@ SCSS
|
|
1124
1235
|
a: b
|
1125
1236
|
SASS
|
1126
1237
|
#{s} {
|
1127
|
-
a: b;
|
1238
|
+
a: b;
|
1239
|
+
}
|
1128
1240
|
SCSS
|
1129
1241
|
end
|
1130
1242
|
|
@@ -1157,8 +1269,10 @@ div {
|
|
1157
1269
|
before: before;
|
1158
1270
|
background: {
|
1159
1271
|
color: blue;
|
1160
|
-
repeat: no-repeat;
|
1161
|
-
|
1272
|
+
repeat: no-repeat;
|
1273
|
+
};
|
1274
|
+
after: after;
|
1275
|
+
}
|
1162
1276
|
|
1163
1277
|
SCSS
|
1164
1278
|
end
|
@@ -1166,17 +1280,22 @@ SCSS
|
|
1166
1280
|
def test_dasherize
|
1167
1281
|
assert_sass_to_scss(<<SCSS, <<SASS, :dasherize => true)
|
1168
1282
|
@mixin under-scored-mixin($under-scored-arg: $under-scored-default) {
|
1169
|
-
bar: $under-scored-arg;
|
1283
|
+
bar: $under-scored-arg;
|
1284
|
+
}
|
1170
1285
|
|
1171
1286
|
div {
|
1172
1287
|
foo: under-scored-fn($under-scored-var + "before\#{$another-under-scored-var}after");
|
1173
1288
|
@include under-scored-mixin($passed-arg);
|
1174
|
-
selector-\#{$under-scored-interp}: bold;
|
1289
|
+
selector-\#{$under-scored-interp}: bold;
|
1290
|
+
}
|
1175
1291
|
|
1176
1292
|
@if $under-scored {
|
1177
1293
|
@for $for-var from $from-var to $to-var {
|
1178
1294
|
@while $while-var == true {
|
1179
|
-
$while-var: false;
|
1295
|
+
$while-var: false;
|
1296
|
+
}
|
1297
|
+
}
|
1298
|
+
}
|
1180
1299
|
SCSS
|
1181
1300
|
=under_scored_mixin($under_scored_arg: $under_scored_default)
|
1182
1301
|
bar: $under_scored_arg
|
@@ -1219,11 +1338,15 @@ $color: blue;
|
|
1219
1338
|
.\#{$class} {
|
1220
1339
|
background-color: $color;
|
1221
1340
|
@content;
|
1222
|
-
border-color: $color;
|
1341
|
+
border-color: $color;
|
1342
|
+
}
|
1343
|
+
}
|
1223
1344
|
|
1224
1345
|
@include context(parent) {
|
1225
1346
|
@include context(child, $color: yellow) {
|
1226
|
-
color: $color;
|
1347
|
+
color: $color;
|
1348
|
+
}
|
1349
|
+
}
|
1227
1350
|
SCSS
|
1228
1351
|
|
1229
1352
|
end
|
@@ -1231,7 +1354,8 @@ SCSS
|
|
1231
1354
|
def test_empty_content
|
1232
1355
|
assert_scss_to_scss(<<SCSS)
|
1233
1356
|
@mixin foo {
|
1234
|
-
@content;
|
1357
|
+
@content;
|
1358
|
+
}
|
1235
1359
|
|
1236
1360
|
@include foo {}
|
1237
1361
|
SCSS
|
@@ -1243,7 +1367,8 @@ SCSS
|
|
1243
1367
|
color: blue
|
1244
1368
|
SASS
|
1245
1369
|
#content a%foo.bar {
|
1246
|
-
color: blue;
|
1370
|
+
color: blue;
|
1371
|
+
}
|
1247
1372
|
SCSS
|
1248
1373
|
end
|
1249
1374
|
|
@@ -1260,13 +1385,114 @@ SASS
|
|
1260
1385
|
$foo: foo;
|
1261
1386
|
|
1262
1387
|
%\#{$foo} {
|
1263
|
-
color: blue;
|
1388
|
+
color: blue;
|
1389
|
+
}
|
1264
1390
|
|
1265
1391
|
.bar {
|
1266
|
-
@extend %foo;
|
1392
|
+
@extend %foo;
|
1393
|
+
}
|
1267
1394
|
SCSS
|
1268
1395
|
end
|
1269
1396
|
|
1397
|
+
def test_indent
|
1398
|
+
assert_renders <<SASS, <<SCSS, :indent => " "
|
1399
|
+
foo bar
|
1400
|
+
baz bang
|
1401
|
+
baz: bang
|
1402
|
+
bip: bop
|
1403
|
+
blat: boo
|
1404
|
+
SASS
|
1405
|
+
foo bar {
|
1406
|
+
baz bang {
|
1407
|
+
baz: bang;
|
1408
|
+
bip: bop;
|
1409
|
+
}
|
1410
|
+
blat: boo;
|
1411
|
+
}
|
1412
|
+
SCSS
|
1413
|
+
|
1414
|
+
assert_renders <<SASS, <<SCSS, :indent => "\t"
|
1415
|
+
foo bar
|
1416
|
+
baz bang
|
1417
|
+
baz: bang
|
1418
|
+
bip: bop
|
1419
|
+
blat: boo
|
1420
|
+
SASS
|
1421
|
+
foo bar {
|
1422
|
+
baz bang {
|
1423
|
+
baz: bang;
|
1424
|
+
bip: bop;
|
1425
|
+
}
|
1426
|
+
blat: boo;
|
1427
|
+
}
|
1428
|
+
SCSS
|
1429
|
+
|
1430
|
+
assert_sass_to_scss <<SCSS, <<SASS, :indent => " "
|
1431
|
+
foo bar {
|
1432
|
+
baz bang {
|
1433
|
+
baz: bang;
|
1434
|
+
bip: bop;
|
1435
|
+
}
|
1436
|
+
blat: boo;
|
1437
|
+
}
|
1438
|
+
SCSS
|
1439
|
+
foo bar
|
1440
|
+
baz bang
|
1441
|
+
baz: bang
|
1442
|
+
bip: bop
|
1443
|
+
blat: boo
|
1444
|
+
SASS
|
1445
|
+
|
1446
|
+
assert_sass_to_scss <<SCSS, <<SASS, :indent => "\t"
|
1447
|
+
foo bar {
|
1448
|
+
baz bang {
|
1449
|
+
baz: bang;
|
1450
|
+
bip: bop;
|
1451
|
+
}
|
1452
|
+
blat: boo;
|
1453
|
+
}
|
1454
|
+
SCSS
|
1455
|
+
foo bar
|
1456
|
+
baz bang
|
1457
|
+
baz: bang
|
1458
|
+
bip: bop
|
1459
|
+
blat: boo
|
1460
|
+
SASS
|
1461
|
+
|
1462
|
+
assert_scss_to_sass <<SASS, <<SCSS, :indent => " "
|
1463
|
+
foo bar
|
1464
|
+
baz bang
|
1465
|
+
baz: bang
|
1466
|
+
bip: bop
|
1467
|
+
blat: boo
|
1468
|
+
SASS
|
1469
|
+
foo bar {
|
1470
|
+
baz bang {
|
1471
|
+
baz: bang;
|
1472
|
+
bip: bop;
|
1473
|
+
}
|
1474
|
+
blat: boo;
|
1475
|
+
}
|
1476
|
+
SCSS
|
1477
|
+
|
1478
|
+
assert_scss_to_sass <<SASS, <<SCSS, :indent => "\t"
|
1479
|
+
foo bar
|
1480
|
+
baz bang
|
1481
|
+
baz: bang
|
1482
|
+
bip: bop
|
1483
|
+
blat: boo
|
1484
|
+
SASS
|
1485
|
+
foo bar {
|
1486
|
+
baz bang {
|
1487
|
+
baz: bang;
|
1488
|
+
bip: bop;
|
1489
|
+
}
|
1490
|
+
blat: boo;
|
1491
|
+
}
|
1492
|
+
SCSS
|
1493
|
+
end
|
1494
|
+
|
1495
|
+
|
1270
1496
|
private
|
1271
1497
|
|
1272
1498
|
def assert_sass_to_sass(sass, options = {})
|