sass 3.4.0 → 3.4.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +3 -1
- data/CODE_OF_CONDUCT.md +10 -0
- data/CONTRIBUTING.md +148 -0
- data/MIT-LICENSE +1 -1
- data/README.md +26 -20
- data/Rakefile +103 -20
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/extra/sass-spec-ref.sh +32 -0
- data/extra/update_watch.rb +1 -1
- data/lib/sass/cache_stores/filesystem.rb +7 -7
- data/lib/sass/cache_stores/memory.rb +4 -5
- data/lib/sass/callbacks.rb +2 -2
- data/lib/sass/css.rb +11 -10
- data/lib/sass/deprecation.rb +55 -0
- data/lib/sass/engine.rb +83 -38
- data/lib/sass/environment.rb +26 -2
- data/lib/sass/error.rb +12 -12
- data/lib/sass/exec/base.rb +15 -3
- data/lib/sass/exec/sass_convert.rb +34 -15
- data/lib/sass/exec/sass_scss.rb +23 -7
- data/lib/sass/features.rb +2 -2
- data/lib/sass/importers/base.rb +1 -1
- data/lib/sass/importers/deprecated_path.rb +51 -0
- data/lib/sass/importers/filesystem.rb +24 -16
- data/lib/sass/importers.rb +1 -0
- data/lib/sass/logger/base.rb +8 -2
- data/lib/sass/logger/delayed.rb +50 -0
- data/lib/sass/logger.rb +8 -3
- data/lib/sass/plugin/compiler.rb +42 -25
- data/lib/sass/plugin/configuration.rb +38 -22
- data/lib/sass/plugin/merb.rb +2 -2
- data/lib/sass/plugin/rack.rb +3 -3
- data/lib/sass/plugin/rails.rb +1 -1
- data/lib/sass/plugin/staleness_checker.rb +3 -3
- data/lib/sass/plugin.rb +3 -2
- data/lib/sass/script/css_parser.rb +2 -3
- data/lib/sass/script/css_variable_warning.rb +52 -0
- data/lib/sass/script/functions.rb +140 -73
- data/lib/sass/script/lexer.rb +37 -22
- data/lib/sass/script/parser.rb +235 -40
- data/lib/sass/script/tree/funcall.rb +12 -5
- data/lib/sass/script/tree/interpolation.rb +109 -4
- data/lib/sass/script/tree/list_literal.rb +31 -4
- data/lib/sass/script/tree/literal.rb +4 -0
- data/lib/sass/script/tree/node.rb +21 -3
- data/lib/sass/script/tree/operation.rb +54 -1
- data/lib/sass/script/tree/string_interpolation.rb +58 -37
- data/lib/sass/script/tree/variable.rb +1 -1
- data/lib/sass/script/value/base.rb +10 -9
- data/lib/sass/script/value/color.rb +42 -24
- data/lib/sass/script/value/helpers.rb +16 -6
- data/lib/sass/script/value/map.rb +1 -1
- data/lib/sass/script/value/number.rb +52 -19
- data/lib/sass/script/value/string.rb +46 -5
- data/lib/sass/script.rb +3 -3
- data/lib/sass/scss/css_parser.rb +16 -2
- data/lib/sass/scss/parser.rb +120 -75
- data/lib/sass/scss/rx.rb +9 -10
- data/lib/sass/scss/static_parser.rb +19 -14
- data/lib/sass/scss.rb +0 -2
- data/lib/sass/selector/abstract_sequence.rb +8 -6
- data/lib/sass/selector/comma_sequence.rb +25 -9
- data/lib/sass/selector/pseudo.rb +45 -35
- data/lib/sass/selector/sequence.rb +54 -18
- data/lib/sass/selector/simple.rb +11 -11
- data/lib/sass/selector/simple_sequence.rb +34 -15
- data/lib/sass/selector.rb +7 -10
- data/lib/sass/shared.rb +1 -1
- data/lib/sass/source/map.rb +7 -4
- data/lib/sass/source/position.rb +4 -4
- data/lib/sass/stack.rb +2 -2
- data/lib/sass/supports.rb +8 -10
- data/lib/sass/tree/comment_node.rb +1 -1
- data/lib/sass/tree/css_import_node.rb +9 -1
- data/lib/sass/tree/function_node.rb +8 -3
- data/lib/sass/tree/import_node.rb +6 -5
- data/lib/sass/tree/node.rb +5 -3
- data/lib/sass/tree/prop_node.rb +5 -6
- data/lib/sass/tree/rule_node.rb +14 -4
- data/lib/sass/tree/visitors/check_nesting.rb +18 -22
- data/lib/sass/tree/visitors/convert.rb +43 -26
- data/lib/sass/tree/visitors/cssize.rb +5 -1
- data/lib/sass/tree/visitors/deep_copy.rb +1 -1
- data/lib/sass/tree/visitors/extend.rb +15 -13
- data/lib/sass/tree/visitors/perform.rb +42 -17
- data/lib/sass/tree/visitors/set_options.rb +1 -1
- data/lib/sass/tree/visitors/to_css.rb +58 -30
- data/lib/sass/util/multibyte_string_scanner.rb +0 -2
- data/lib/sass/util/normalized_map.rb +0 -1
- data/lib/sass/util/subset_map.rb +1 -2
- data/lib/sass/util.rb +125 -68
- data/lib/sass/version.rb +2 -2
- data/lib/sass.rb +10 -3
- data/test/sass/compiler_test.rb +6 -2
- data/test/sass/conversion_test.rb +187 -53
- data/test/sass/css2sass_test.rb +50 -1
- data/test/sass/css_variable_test.rb +132 -0
- data/test/sass/engine_test.rb +207 -61
- data/test/sass/exec_test.rb +10 -0
- data/test/sass/extend_test.rb +101 -29
- data/test/sass/functions_test.rb +60 -9
- data/test/sass/importer_test.rb +9 -0
- data/test/sass/more_templates/more1.sass +10 -10
- data/test/sass/more_templates/more_import.sass +2 -2
- data/test/sass/plugin_test.rb +10 -8
- data/test/sass/results/script.css +3 -3
- data/test/sass/script_conversion_test.rb +58 -29
- data/test/sass/script_test.rb +430 -53
- data/test/sass/scss/css_test.rb +73 -7
- data/test/sass/scss/rx_test.rb +4 -0
- data/test/sass/scss/scss_test.rb +309 -4
- data/test/sass/source_map_test.rb +152 -74
- data/test/sass/superselector_test.rb +19 -0
- data/test/sass/templates/_partial.sass +1 -1
- data/test/sass/templates/basic.sass +10 -10
- data/test/sass/templates/bork1.sass +1 -1
- data/test/sass/templates/bork5.sass +1 -1
- data/test/sass/templates/compact.sass +10 -10
- data/test/sass/templates/complex.sass +187 -187
- data/test/sass/templates/compressed.sass +10 -10
- data/test/sass/templates/expanded.sass +10 -10
- data/test/sass/templates/import.sass +2 -2
- data/test/sass/templates/importee.sass +3 -3
- data/test/sass/templates/mixins.sass +22 -22
- data/test/sass/templates/multiline.sass +4 -4
- data/test/sass/templates/nested.sass +13 -13
- data/test/sass/templates/parent_ref.sass +12 -12
- data/test/sass/templates/script.sass +70 -70
- data/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +1 -1
- data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +2 -2
- data/test/sass/templates/subdir/subdir.sass +3 -3
- data/test/sass/templates/units.sass +10 -10
- data/test/sass/util/multibyte_string_scanner_test.rb +10 -2
- data/test/sass/util_test.rb +15 -44
- data/test/sass-spec.yml +3 -0
- data/test/test_helper.rb +5 -4
- metadata +302 -295
- data/CONTRIBUTING +0 -3
- data/lib/sass/scss/script_lexer.rb +0 -15
- data/lib/sass/scss/script_parser.rb +0 -25
@@ -13,7 +13,7 @@ foo bar {
|
|
13
13
|
bip: bop;
|
14
14
|
}
|
15
15
|
SCSS
|
16
|
-
assert_renders <<SASS, <<SCSS, :old => true
|
16
|
+
silence_warnings {assert_renders <<SASS, <<SCSS, :old => true}
|
17
17
|
foo bar
|
18
18
|
:baz bang
|
19
19
|
:bip bop
|
@@ -30,8 +30,7 @@ SCSS
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def test_empty_directive
|
33
|
-
|
34
|
-
assert_scss_to_scss "@media screen {}"
|
33
|
+
assert_renders "@media screen", "@media screen {}"
|
35
34
|
end
|
36
35
|
|
37
36
|
def test_empty_control_directive
|
@@ -44,6 +43,7 @@ foo bar
|
|
44
43
|
baz bang
|
45
44
|
baz: bang
|
46
45
|
bip: bop
|
46
|
+
|
47
47
|
blat: boo
|
48
48
|
SASS
|
49
49
|
foo bar {
|
@@ -51,6 +51,7 @@ foo bar {
|
|
51
51
|
baz: bang;
|
52
52
|
bip: bop;
|
53
53
|
}
|
54
|
+
|
54
55
|
blat: boo;
|
55
56
|
}
|
56
57
|
SCSS
|
@@ -182,7 +183,7 @@ SCSS
|
|
182
183
|
end
|
183
184
|
|
184
185
|
def test_dynamic_properties_with_old
|
185
|
-
assert_renders <<SASS, <<SCSS, :old => true
|
186
|
+
silence_warnings {assert_renders <<SASS, <<SCSS, :old => true}
|
186
187
|
foo bar
|
187
188
|
:baz 12 $bang "bip"
|
188
189
|
SASS
|
@@ -287,41 +288,45 @@ foo bar {
|
|
287
288
|
}
|
288
289
|
SCSS
|
289
290
|
|
290
|
-
|
291
|
+
assert_renders <<SASS, <<SCSS
|
291
292
|
// foo
|
292
293
|
// bar
|
293
294
|
// baz
|
294
295
|
// bang
|
295
296
|
|
296
|
-
foo bar
|
297
|
-
a: b
|
298
|
-
|
299
|
-
SCSS
|
297
|
+
foo bar
|
298
|
+
a: b
|
299
|
+
SASS
|
300
300
|
// foo
|
301
301
|
// bar
|
302
302
|
// baz
|
303
303
|
// bang
|
304
304
|
|
305
|
-
foo bar
|
306
|
-
a: b
|
307
|
-
|
305
|
+
foo bar {
|
306
|
+
a: b;
|
307
|
+
}
|
308
|
+
SCSS
|
308
309
|
end
|
309
310
|
|
310
311
|
def test_nested_silent_comments
|
311
312
|
assert_renders <<SASS, <<SCSS
|
312
313
|
foo
|
313
314
|
bar: baz
|
315
|
+
|
314
316
|
// bip bop
|
315
317
|
// beep boop
|
316
318
|
bang: bizz
|
319
|
+
|
317
320
|
// bubble bubble
|
318
321
|
// toil trouble
|
319
322
|
SASS
|
320
323
|
foo {
|
321
324
|
bar: baz;
|
325
|
+
|
322
326
|
// bip bop
|
323
327
|
// beep boop
|
324
328
|
bang: bizz;
|
329
|
+
|
325
330
|
// bubble bubble
|
326
331
|
// toil trouble
|
327
332
|
}
|
@@ -330,10 +335,12 @@ SCSS
|
|
330
335
|
assert_sass_to_scss <<SCSS, <<SASS
|
331
336
|
foo {
|
332
337
|
bar: baz;
|
338
|
+
|
333
339
|
// bip bop
|
334
340
|
// beep boop
|
335
341
|
// bap blimp
|
336
342
|
bang: bizz;
|
343
|
+
|
337
344
|
// bubble bubble
|
338
345
|
// toil trouble
|
339
346
|
// gorp
|
@@ -341,16 +348,35 @@ foo {
|
|
341
348
|
SCSS
|
342
349
|
foo
|
343
350
|
bar: baz
|
351
|
+
|
344
352
|
// bip bop
|
345
353
|
beep boop
|
346
354
|
bap blimp
|
347
355
|
bang: bizz
|
356
|
+
|
348
357
|
// bubble bubble
|
349
358
|
toil trouble
|
350
359
|
gorp
|
351
360
|
SASS
|
352
361
|
end
|
353
362
|
|
363
|
+
def test_preserves_triple_slash_comments
|
364
|
+
assert_renders <<SASS, <<SCSS
|
365
|
+
/// foo
|
366
|
+
/// bar
|
367
|
+
foo
|
368
|
+
/// bip bop
|
369
|
+
/// beep boop
|
370
|
+
SASS
|
371
|
+
/// foo
|
372
|
+
/// bar
|
373
|
+
foo {
|
374
|
+
/// bip bop
|
375
|
+
/// beep boop
|
376
|
+
}
|
377
|
+
SCSS
|
378
|
+
end
|
379
|
+
|
354
380
|
def test_loud_comments
|
355
381
|
assert_renders <<SASS, <<SCSS
|
356
382
|
/* foo
|
@@ -427,17 +453,21 @@ SCSS
|
|
427
453
|
assert_renders <<SASS, <<SCSS
|
428
454
|
foo
|
429
455
|
bar: baz
|
456
|
+
|
430
457
|
/* bip bop
|
431
458
|
* beep boop
|
432
459
|
bang: bizz
|
460
|
+
|
433
461
|
/* bubble bubble
|
434
462
|
* toil trouble
|
435
463
|
SASS
|
436
464
|
foo {
|
437
465
|
bar: baz;
|
466
|
+
|
438
467
|
/* bip bop
|
439
468
|
* beep boop */
|
440
469
|
bang: bizz;
|
470
|
+
|
441
471
|
/* bubble bubble
|
442
472
|
* toil trouble */
|
443
473
|
}
|
@@ -446,10 +476,12 @@ SCSS
|
|
446
476
|
assert_sass_to_scss <<SCSS, <<SASS
|
447
477
|
foo {
|
448
478
|
bar: baz;
|
479
|
+
|
449
480
|
/* bip bop
|
450
481
|
* beep boop
|
451
482
|
* bap blimp */
|
452
483
|
bang: bizz;
|
484
|
+
|
453
485
|
/* bubble bubble
|
454
486
|
* toil trouble
|
455
487
|
* gorp */
|
@@ -457,16 +489,35 @@ foo {
|
|
457
489
|
SCSS
|
458
490
|
foo
|
459
491
|
bar: baz
|
492
|
+
|
460
493
|
/* bip bop
|
461
494
|
beep boop
|
462
495
|
bap blimp
|
463
496
|
bang: bizz
|
497
|
+
|
464
498
|
/* bubble bubble
|
465
499
|
toil trouble
|
466
500
|
gorp
|
467
501
|
SASS
|
468
502
|
end
|
469
503
|
|
504
|
+
def test_preserves_double_star_comments
|
505
|
+
assert_renders <<SASS, <<SCSS
|
506
|
+
/** foo
|
507
|
+
* bar
|
508
|
+
foo
|
509
|
+
/** bip bop
|
510
|
+
* beep boop
|
511
|
+
SASS
|
512
|
+
/** foo
|
513
|
+
* bar */
|
514
|
+
foo {
|
515
|
+
/** bip bop
|
516
|
+
* beep boop */
|
517
|
+
}
|
518
|
+
SCSS
|
519
|
+
end
|
520
|
+
|
470
521
|
def test_loud_comments_with_weird_indentation
|
471
522
|
assert_scss_to_sass <<SASS, <<SCSS
|
472
523
|
foo
|
@@ -580,10 +631,12 @@ SASS
|
|
580
631
|
assert_renders <<SASS, <<SCSS
|
581
632
|
foo
|
582
633
|
@debug 12px
|
634
|
+
|
583
635
|
bar: baz
|
584
636
|
SASS
|
585
637
|
foo {
|
586
638
|
@debug 12px;
|
639
|
+
|
587
640
|
bar: baz;
|
588
641
|
}
|
589
642
|
SCSS
|
@@ -593,10 +646,12 @@ SCSS
|
|
593
646
|
assert_renders <<SASS, <<SCSS
|
594
647
|
foo
|
595
648
|
@error "oh no!"
|
649
|
+
|
596
650
|
bar: baz
|
597
651
|
SASS
|
598
652
|
foo {
|
599
653
|
@error "oh no!";
|
654
|
+
|
600
655
|
bar: baz;
|
601
656
|
}
|
602
657
|
SCSS
|
@@ -606,10 +661,12 @@ SCSS
|
|
606
661
|
assert_renders <<SASS, <<SCSS
|
607
662
|
foo
|
608
663
|
@foo #bar "baz"
|
664
|
+
|
609
665
|
bar: baz
|
610
666
|
SASS
|
611
667
|
foo {
|
612
668
|
@foo #bar "baz";
|
669
|
+
|
613
670
|
bar: baz;
|
614
671
|
}
|
615
672
|
SCSS
|
@@ -641,6 +698,7 @@ foo
|
|
641
698
|
@foo #bar "baz"
|
642
699
|
#blat
|
643
700
|
a: b
|
701
|
+
|
644
702
|
.bang
|
645
703
|
c: d
|
646
704
|
e: f
|
@@ -652,6 +710,7 @@ foo {
|
|
652
710
|
#blat {
|
653
711
|
a: b;
|
654
712
|
}
|
713
|
+
|
655
714
|
.bang {
|
656
715
|
c: d;
|
657
716
|
e: f;
|
@@ -668,11 +727,14 @@ SCSS
|
|
668
727
|
foo
|
669
728
|
@foo #bar "baz"
|
670
729
|
g: h
|
730
|
+
|
671
731
|
#blat
|
672
732
|
a: b
|
733
|
+
|
673
734
|
.bang
|
674
735
|
c: d
|
675
736
|
e: f
|
737
|
+
|
676
738
|
i: j
|
677
739
|
|
678
740
|
bar: baz
|
@@ -680,13 +742,16 @@ SASS
|
|
680
742
|
foo {
|
681
743
|
@foo #bar "baz" {
|
682
744
|
g: h;
|
745
|
+
|
683
746
|
#blat {
|
684
747
|
a: b;
|
685
748
|
}
|
749
|
+
|
686
750
|
.bang {
|
687
751
|
c: d;
|
688
752
|
e: f;
|
689
753
|
}
|
754
|
+
|
690
755
|
i: j;
|
691
756
|
}
|
692
757
|
|
@@ -708,6 +773,7 @@ SCSS
|
|
708
773
|
foo
|
709
774
|
@for $a from $b to $c
|
710
775
|
a: b
|
776
|
+
|
711
777
|
@for $c from 1 to 16
|
712
778
|
d: e
|
713
779
|
f: g
|
@@ -716,6 +782,7 @@ foo {
|
|
716
782
|
@for $a from $b to $c {
|
717
783
|
a: b;
|
718
784
|
}
|
785
|
+
|
719
786
|
@for $c from 1 to 16 {
|
720
787
|
d: e;
|
721
788
|
f: g;
|
@@ -729,6 +796,7 @@ SCSS
|
|
729
796
|
foo
|
730
797
|
@while flaz($a + $b)
|
731
798
|
a: b
|
799
|
+
|
732
800
|
@while 1
|
733
801
|
d: e
|
734
802
|
f: g
|
@@ -737,6 +805,7 @@ foo {
|
|
737
805
|
@while flaz($a + $b) {
|
738
806
|
a: b;
|
739
807
|
}
|
808
|
+
|
740
809
|
@while 1 {
|
741
810
|
d: e;
|
742
811
|
f: g;
|
@@ -750,6 +819,7 @@ SCSS
|
|
750
819
|
foo
|
751
820
|
@if $foo or $bar
|
752
821
|
a: b
|
822
|
+
|
753
823
|
@if $baz
|
754
824
|
d: e
|
755
825
|
@else if $bang
|
@@ -761,6 +831,7 @@ foo {
|
|
761
831
|
@if $foo or $bar {
|
762
832
|
a: b;
|
763
833
|
}
|
834
|
+
|
764
835
|
@if $baz {
|
765
836
|
d: e;
|
766
837
|
}
|
@@ -906,10 +977,12 @@ SCSS
|
|
906
977
|
assert_renders <<SASS, <<SCSS
|
907
978
|
.foo
|
908
979
|
@extend .bar
|
980
|
+
|
909
981
|
@extend .baz:bang
|
910
982
|
SASS
|
911
983
|
.foo {
|
912
984
|
@extend .bar;
|
985
|
+
|
913
986
|
@extend .baz:bang;
|
914
987
|
}
|
915
988
|
SCSS
|
@@ -1008,10 +1081,12 @@ SASS
|
|
1008
1081
|
assert_renders <<SASS, <<SCSS
|
1009
1082
|
foo
|
1010
1083
|
+foo-bar
|
1084
|
+
|
1011
1085
|
a: blip
|
1012
1086
|
SASS
|
1013
1087
|
foo {
|
1014
1088
|
@include foo-bar;
|
1089
|
+
|
1015
1090
|
a: blip;
|
1016
1091
|
}
|
1017
1092
|
SCSS
|
@@ -1021,10 +1096,12 @@ SCSS
|
|
1021
1096
|
assert_renders <<SASS, <<SCSS
|
1022
1097
|
foo
|
1023
1098
|
+foo-bar(12px, "blaz")
|
1099
|
+
|
1024
1100
|
a: blip
|
1025
1101
|
SASS
|
1026
1102
|
foo {
|
1027
1103
|
@include foo-bar(12px, "blaz");
|
1104
|
+
|
1028
1105
|
a: blip;
|
1029
1106
|
}
|
1030
1107
|
SCSS
|
@@ -1034,12 +1111,33 @@ SCSS
|
|
1034
1111
|
assert_renders <<SASS, <<SCSS
|
1035
1112
|
foo
|
1036
1113
|
+foo-bar(12px, "blaz", $blip: blap, $bloop: blop)
|
1114
|
+
|
1037
1115
|
+foo-bar($blip: blap, $bloop: blop)
|
1116
|
+
|
1038
1117
|
a: blip
|
1039
1118
|
SASS
|
1040
1119
|
foo {
|
1041
1120
|
@include foo-bar(12px, "blaz", $blip: blap, $bloop: blop);
|
1121
|
+
|
1042
1122
|
@include foo-bar($blip: blap, $bloop: blop);
|
1123
|
+
|
1124
|
+
a: blip;
|
1125
|
+
}
|
1126
|
+
SCSS
|
1127
|
+
end
|
1128
|
+
|
1129
|
+
def test_consecutive_mixin_includes
|
1130
|
+
assert_renders <<SASS, <<SCSS
|
1131
|
+
foo
|
1132
|
+
+foo-bar
|
1133
|
+
+foo-bar
|
1134
|
+
|
1135
|
+
a: blip
|
1136
|
+
SASS
|
1137
|
+
foo {
|
1138
|
+
@include foo-bar;
|
1139
|
+
@include foo-bar;
|
1140
|
+
|
1043
1141
|
a: blip;
|
1044
1142
|
}
|
1045
1143
|
SCSS
|
@@ -1049,10 +1147,12 @@ SCSS
|
|
1049
1147
|
assert_renders <<SASS, <<SCSS
|
1050
1148
|
foo
|
1051
1149
|
+foo-bar($a-b_c: val)
|
1150
|
+
|
1052
1151
|
a: blip
|
1053
1152
|
SASS
|
1054
1153
|
foo {
|
1055
1154
|
@include foo-bar($a-b_c: val);
|
1155
|
+
|
1056
1156
|
a: blip;
|
1057
1157
|
}
|
1058
1158
|
SCSS
|
@@ -1062,10 +1162,12 @@ SCSS
|
|
1062
1162
|
assert_renders <<SASS, <<SCSS
|
1063
1163
|
@function foo()
|
1064
1164
|
$var: 1 + 1
|
1165
|
+
|
1065
1166
|
@return $var
|
1066
1167
|
SASS
|
1067
1168
|
@function foo() {
|
1068
1169
|
$var: 1 + 1;
|
1170
|
+
|
1069
1171
|
@return $var;
|
1070
1172
|
}
|
1071
1173
|
SCSS
|
@@ -1105,12 +1207,14 @@ $var1: 12px + 15px
|
|
1105
1207
|
|
1106
1208
|
foo
|
1107
1209
|
$var2: flaz(#abcdef)
|
1210
|
+
|
1108
1211
|
val: $var1 $var2
|
1109
1212
|
SASS
|
1110
1213
|
$var1: 12px + 15px;
|
1111
1214
|
|
1112
1215
|
foo {
|
1113
1216
|
$var2: flaz(#abcdef);
|
1217
|
+
|
1114
1218
|
val: $var1 $var2;
|
1115
1219
|
}
|
1116
1220
|
SCSS
|
@@ -1122,12 +1226,14 @@ $var1: 12px + 15px !default
|
|
1122
1226
|
|
1123
1227
|
foo
|
1124
1228
|
$var2: flaz(#abcdef) !default
|
1229
|
+
|
1125
1230
|
val: $var1 $var2
|
1126
1231
|
SASS
|
1127
1232
|
$var1: 12px + 15px !default;
|
1128
1233
|
|
1129
1234
|
foo {
|
1130
1235
|
$var2: flaz(#abcdef) !default;
|
1236
|
+
|
1131
1237
|
val: $var1 $var2;
|
1132
1238
|
}
|
1133
1239
|
SCSS
|
@@ -1207,6 +1313,16 @@ SASS
|
|
1207
1313
|
foo {
|
1208
1314
|
a: 1px / 2px;
|
1209
1315
|
}
|
1316
|
+
SCSS
|
1317
|
+
|
1318
|
+
# Regression test for issue 1787
|
1319
|
+
assert_renders <<SASS, <<SCSS
|
1320
|
+
foo
|
1321
|
+
a: 1px / 2px 3px
|
1322
|
+
SASS
|
1323
|
+
foo {
|
1324
|
+
a: 1px / 2px 3px;
|
1325
|
+
}
|
1210
1326
|
SCSS
|
1211
1327
|
end
|
1212
1328
|
|
@@ -1241,26 +1357,7 @@ SCSS
|
|
1241
1357
|
end
|
1242
1358
|
|
1243
1359
|
def test_media_with_expressions
|
1244
|
-
|
1245
|
-
$media1: screen;
|
1246
|
-
$media2: print;
|
1247
|
-
$var: -webkit-min-device-pixel-ratio;
|
1248
|
-
$val: 20;
|
1249
|
-
|
1250
|
-
@media \#{$media1} and ($var + "-foo": $val + 5), only \#{$media2} {
|
1251
|
-
a: b;
|
1252
|
-
}
|
1253
|
-
SCSS
|
1254
|
-
$media1: screen
|
1255
|
-
$media2: print
|
1256
|
-
$var: -webkit-min-device-pixel-ratio
|
1257
|
-
$val: 20
|
1258
|
-
|
1259
|
-
@media \#{$media1} and ($var + "-foo": $val + 5), only \#{$media2}
|
1260
|
-
a: b
|
1261
|
-
SASS
|
1262
|
-
|
1263
|
-
assert_scss_to_sass <<SASS, <<SCSS
|
1360
|
+
assert_renders <<SASS, <<SCSS
|
1264
1361
|
$media1: screen
|
1265
1362
|
$media2: print
|
1266
1363
|
$var: -webkit-min-device-pixel-ratio
|
@@ -1281,14 +1378,14 @@ SCSS
|
|
1281
1378
|
end
|
1282
1379
|
|
1283
1380
|
def test_media_with_feature
|
1284
|
-
|
1381
|
+
assert_renders <<SASS, <<SCSS
|
1382
|
+
@media screen and (-webkit-transform-3d)
|
1383
|
+
a: b
|
1384
|
+
SASS
|
1285
1385
|
@media screen and (-webkit-transform-3d) {
|
1286
1386
|
a: b;
|
1287
1387
|
}
|
1288
1388
|
SCSS
|
1289
|
-
@media screen and (-webkit-transform-3d)
|
1290
|
-
a: b
|
1291
|
-
SASS
|
1292
1389
|
end
|
1293
1390
|
|
1294
1391
|
def test_supports_with_expressions
|
@@ -1297,7 +1394,7 @@ $query: "(feature1: val)"
|
|
1297
1394
|
$feature: feature2
|
1298
1395
|
$val: val
|
1299
1396
|
|
1300
|
-
@supports \#{$query} and ($feature: $val) or (not ($feature + 3: $val + 4))
|
1397
|
+
@supports (\#{$query} and ($feature: $val)) or (not ($feature + 3: $val + 4))
|
1301
1398
|
foo
|
1302
1399
|
a: b
|
1303
1400
|
SASS
|
@@ -1305,7 +1402,7 @@ $query: "(feature1: val)";
|
|
1305
1402
|
$feature: feature2;
|
1306
1403
|
$val: val;
|
1307
1404
|
|
1308
|
-
@supports \#{$query} and ($feature: $val) or (not ($feature + 3: $val + 4)) {
|
1405
|
+
@supports (\#{$query} and ($feature: $val)) or (not ($feature + 3: $val + 4)) {
|
1309
1406
|
foo {
|
1310
1407
|
a: b;
|
1311
1408
|
}
|
@@ -1339,7 +1436,7 @@ SCSS
|
|
1339
1436
|
end
|
1340
1437
|
|
1341
1438
|
def test_old_declaration_hacks
|
1342
|
-
assert_renders <<SASS, <<SCSS, :old => true
|
1439
|
+
silence_warnings {assert_renders <<SASS, <<SCSS, :old => true}
|
1343
1440
|
foo
|
1344
1441
|
:_name val
|
1345
1442
|
:*name val
|
@@ -1414,7 +1511,9 @@ SCSS
|
|
1414
1511
|
|
1415
1512
|
div {
|
1416
1513
|
foo: under-scored-fn($under-scored-var + "before\#{$another-under-scored-var}after");
|
1514
|
+
|
1417
1515
|
@include under-scored-mixin($passed-arg);
|
1516
|
+
|
1418
1517
|
selector-\#{$under-scored-interp}: bold;
|
1419
1518
|
}
|
1420
1519
|
|
@@ -1454,7 +1553,9 @@ $color: blue
|
|
1454
1553
|
=context($class, $color: red)
|
1455
1554
|
.\#{$class}
|
1456
1555
|
background-color: $color
|
1556
|
+
|
1457
1557
|
@content
|
1558
|
+
|
1458
1559
|
border-color: $color
|
1459
1560
|
|
1460
1561
|
+context(parent)
|
@@ -1466,7 +1567,9 @@ $color: blue;
|
|
1466
1567
|
@mixin context($class, $color: red) {
|
1467
1568
|
.\#{$class} {
|
1468
1569
|
background-color: $color;
|
1570
|
+
|
1469
1571
|
@content;
|
1572
|
+
|
1470
1573
|
border-color: $color;
|
1471
1574
|
}
|
1472
1575
|
}
|
@@ -1551,6 +1654,7 @@ foo bar
|
|
1551
1654
|
baz bang
|
1552
1655
|
baz: bang
|
1553
1656
|
bip: bop
|
1657
|
+
|
1554
1658
|
blat: boo
|
1555
1659
|
SASS
|
1556
1660
|
foo bar {
|
@@ -1558,6 +1662,7 @@ foo bar {
|
|
1558
1662
|
baz: bang;
|
1559
1663
|
bip: bop;
|
1560
1664
|
}
|
1665
|
+
|
1561
1666
|
blat: boo;
|
1562
1667
|
}
|
1563
1668
|
SCSS
|
@@ -1567,6 +1672,7 @@ foo bar
|
|
1567
1672
|
baz bang
|
1568
1673
|
baz: bang
|
1569
1674
|
bip: bop
|
1675
|
+
|
1570
1676
|
blat: boo
|
1571
1677
|
SASS
|
1572
1678
|
foo bar {
|
@@ -1574,6 +1680,7 @@ foo bar {
|
|
1574
1680
|
baz: bang;
|
1575
1681
|
bip: bop;
|
1576
1682
|
}
|
1683
|
+
|
1577
1684
|
blat: boo;
|
1578
1685
|
}
|
1579
1686
|
SCSS
|
@@ -1584,6 +1691,7 @@ foo bar {
|
|
1584
1691
|
baz: bang;
|
1585
1692
|
bip: bop;
|
1586
1693
|
}
|
1694
|
+
|
1587
1695
|
blat: boo;
|
1588
1696
|
}
|
1589
1697
|
SCSS
|
@@ -1591,6 +1699,7 @@ foo bar
|
|
1591
1699
|
baz bang
|
1592
1700
|
baz: bang
|
1593
1701
|
bip: bop
|
1702
|
+
|
1594
1703
|
blat: boo
|
1595
1704
|
SASS
|
1596
1705
|
|
@@ -1600,6 +1709,7 @@ foo bar {
|
|
1600
1709
|
baz: bang;
|
1601
1710
|
bip: bop;
|
1602
1711
|
}
|
1712
|
+
|
1603
1713
|
blat: boo;
|
1604
1714
|
}
|
1605
1715
|
SCSS
|
@@ -1607,6 +1717,7 @@ foo bar
|
|
1607
1717
|
baz bang
|
1608
1718
|
baz: bang
|
1609
1719
|
bip: bop
|
1720
|
+
|
1610
1721
|
blat: boo
|
1611
1722
|
SASS
|
1612
1723
|
|
@@ -1615,6 +1726,7 @@ foo bar
|
|
1615
1726
|
baz bang
|
1616
1727
|
baz: bang
|
1617
1728
|
bip: bop
|
1729
|
+
|
1618
1730
|
blat: boo
|
1619
1731
|
SASS
|
1620
1732
|
foo bar {
|
@@ -1622,6 +1734,7 @@ foo bar {
|
|
1622
1734
|
baz: bang;
|
1623
1735
|
bip: bop;
|
1624
1736
|
}
|
1737
|
+
|
1625
1738
|
blat: boo;
|
1626
1739
|
}
|
1627
1740
|
SCSS
|
@@ -1631,6 +1744,7 @@ foo bar
|
|
1631
1744
|
baz bang
|
1632
1745
|
baz: bang
|
1633
1746
|
bip: bop
|
1747
|
+
|
1634
1748
|
blat: boo
|
1635
1749
|
SASS
|
1636
1750
|
foo bar {
|
@@ -1638,13 +1752,14 @@ foo bar {
|
|
1638
1752
|
baz: bang;
|
1639
1753
|
bip: bop;
|
1640
1754
|
}
|
1755
|
+
|
1641
1756
|
blat: boo;
|
1642
1757
|
}
|
1643
1758
|
SCSS
|
1644
1759
|
end
|
1645
1760
|
|
1646
1761
|
def test_extend_with_optional
|
1647
|
-
|
1762
|
+
assert_renders <<SASS, <<SCSS
|
1648
1763
|
foo
|
1649
1764
|
@extend .bar !optional
|
1650
1765
|
SASS
|
@@ -1655,7 +1770,7 @@ SCSS
|
|
1655
1770
|
end
|
1656
1771
|
|
1657
1772
|
def test_mixin_var_args
|
1658
|
-
|
1773
|
+
assert_renders <<SASS, <<SCSS
|
1659
1774
|
=foo($args...)
|
1660
1775
|
a: b
|
1661
1776
|
|
@@ -1664,6 +1779,7 @@ SCSS
|
|
1664
1779
|
|
1665
1780
|
.foo
|
1666
1781
|
+foo($list...)
|
1782
|
+
|
1667
1783
|
+bar(1, $list...)
|
1668
1784
|
SASS
|
1669
1785
|
@mixin foo($args...) {
|
@@ -1676,19 +1792,21 @@ SASS
|
|
1676
1792
|
|
1677
1793
|
.foo {
|
1678
1794
|
@include foo($list...);
|
1795
|
+
|
1679
1796
|
@include bar(1, $list...);
|
1680
1797
|
}
|
1681
1798
|
SCSS
|
1682
1799
|
end
|
1683
1800
|
|
1684
1801
|
def test_mixin_var_kwargs
|
1685
|
-
|
1802
|
+
assert_renders <<SASS, <<SCSS
|
1686
1803
|
=foo($a: b, $c: d)
|
1687
1804
|
a: $a
|
1688
1805
|
c: $c
|
1689
1806
|
|
1690
1807
|
.foo
|
1691
1808
|
+foo($list..., $map...)
|
1809
|
+
|
1692
1810
|
+foo(pos, $list..., $kwd: val, $map...)
|
1693
1811
|
SASS
|
1694
1812
|
@mixin foo($a: b, $c: d) {
|
@@ -1698,13 +1816,14 @@ SASS
|
|
1698
1816
|
|
1699
1817
|
.foo {
|
1700
1818
|
@include foo($list..., $map...);
|
1819
|
+
|
1701
1820
|
@include foo(pos, $list..., $kwd: val, $map...);
|
1702
1821
|
}
|
1703
1822
|
SCSS
|
1704
1823
|
end
|
1705
1824
|
|
1706
1825
|
def test_function_var_args
|
1707
|
-
|
1826
|
+
assert_renders <<SASS, <<SCSS
|
1708
1827
|
@function foo($args...)
|
1709
1828
|
@return foo
|
1710
1829
|
|
@@ -1731,7 +1850,7 @@ SCSS
|
|
1731
1850
|
end
|
1732
1851
|
|
1733
1852
|
def test_function_var_kwargs
|
1734
|
-
|
1853
|
+
assert_renders <<SASS, <<SCSS
|
1735
1854
|
@function foo($a: b, $c: d)
|
1736
1855
|
@return foo
|
1737
1856
|
|
@@ -1751,11 +1870,12 @@ SCSS
|
|
1751
1870
|
end
|
1752
1871
|
|
1753
1872
|
def test_at_root
|
1754
|
-
|
1873
|
+
assert_renders <<SASS, <<SCSS
|
1755
1874
|
.foo
|
1756
1875
|
@at-root
|
1757
1876
|
.bar
|
1758
1877
|
a: b
|
1878
|
+
|
1759
1879
|
.baz
|
1760
1880
|
c: d
|
1761
1881
|
SASS
|
@@ -1764,6 +1884,7 @@ SASS
|
|
1764
1884
|
.bar {
|
1765
1885
|
a: b;
|
1766
1886
|
}
|
1887
|
+
|
1767
1888
|
.baz {
|
1768
1889
|
c: d;
|
1769
1890
|
}
|
@@ -1773,7 +1894,7 @@ SCSS
|
|
1773
1894
|
end
|
1774
1895
|
|
1775
1896
|
def test_at_root_with_selector
|
1776
|
-
|
1897
|
+
assert_renders <<SASS, <<SCSS
|
1777
1898
|
.foo
|
1778
1899
|
@at-root .bar
|
1779
1900
|
a: b
|
@@ -1787,7 +1908,7 @@ SCSS
|
|
1787
1908
|
end
|
1788
1909
|
|
1789
1910
|
def test_at_root_without
|
1790
|
-
|
1911
|
+
assert_renders <<SASS, <<SCSS
|
1791
1912
|
.foo
|
1792
1913
|
@at-root (without: media rule)
|
1793
1914
|
a: b
|
@@ -1801,7 +1922,7 @@ SCSS
|
|
1801
1922
|
end
|
1802
1923
|
|
1803
1924
|
def test_at_root_with
|
1804
|
-
|
1925
|
+
assert_renders <<SASS, <<SCSS
|
1805
1926
|
.foo
|
1806
1927
|
@at-root (with: media rule)
|
1807
1928
|
a: b
|
@@ -1815,7 +1936,7 @@ SCSS
|
|
1815
1936
|
end
|
1816
1937
|
|
1817
1938
|
def test_function_var_kwargs_with_list
|
1818
|
-
|
1939
|
+
assert_renders <<SASS, <<SCSS
|
1819
1940
|
@function foo($a: b, $c: d)
|
1820
1941
|
@return $a, $c
|
1821
1942
|
|
@@ -1838,10 +1959,13 @@ SCSS
|
|
1838
1959
|
0%
|
1839
1960
|
top: 0
|
1840
1961
|
left: 0
|
1962
|
+
|
1841
1963
|
30%
|
1842
1964
|
top: 50px
|
1965
|
+
|
1843
1966
|
68%, 72%
|
1844
1967
|
left: 50px
|
1968
|
+
|
1845
1969
|
100%
|
1846
1970
|
top: 100px
|
1847
1971
|
left: 100%
|
@@ -1851,12 +1975,15 @@ SASS
|
|
1851
1975
|
top: 0;
|
1852
1976
|
left: 0;
|
1853
1977
|
}
|
1978
|
+
|
1854
1979
|
30% {
|
1855
1980
|
top: 50px;
|
1856
1981
|
}
|
1982
|
+
|
1857
1983
|
68%, 72% {
|
1858
1984
|
left: 50px;
|
1859
1985
|
}
|
1986
|
+
|
1860
1987
|
100% {
|
1861
1988
|
top: 100px;
|
1862
1989
|
left: 100%;
|
@@ -1884,12 +2011,13 @@ SCSS
|
|
1884
2011
|
end
|
1885
2012
|
|
1886
2013
|
def test_media_query_with_expr
|
1887
|
-
|
2014
|
+
assert_renders <<SASS, <<SCSS
|
1888
2015
|
@media foo and (bar: baz)
|
1889
2016
|
a: b
|
1890
2017
|
SASS
|
1891
2018
|
@media foo and (bar: baz) {
|
1892
|
-
a: b;
|
2019
|
+
a: b;
|
2020
|
+
}
|
1893
2021
|
SCSS
|
1894
2022
|
end
|
1895
2023
|
|
@@ -1975,13 +2103,11 @@ foo
|
|
1975
2103
|
ok: -$foo
|
1976
2104
|
comma: 10px, -$foo
|
1977
2105
|
needs-parens: 10px (-$foo)
|
1978
|
-
no-parens: a 50px + 60px b
|
1979
2106
|
SASS
|
1980
2107
|
foo {
|
1981
2108
|
ok: -$foo;
|
1982
2109
|
comma: 10px, -$foo;
|
1983
2110
|
needs-parens: 10px (-$foo);
|
1984
|
-
no-parens: a 50px + 60px b;
|
1985
2111
|
}
|
1986
2112
|
SCSS
|
1987
2113
|
end
|
@@ -2003,6 +2129,14 @@ foo {
|
|
2003
2129
|
SCSS
|
2004
2130
|
end
|
2005
2131
|
|
2132
|
+
def test_import_with_supports_clause
|
2133
|
+
assert_renders(<<'SASS', <<'SCSS')
|
2134
|
+
@import url("fallback-layout.css") supports(not (display: #{$display-type}))
|
2135
|
+
SASS
|
2136
|
+
@import url("fallback-layout.css") supports(not (display: #{$display-type}));
|
2137
|
+
SCSS
|
2138
|
+
end
|
2139
|
+
|
2006
2140
|
private
|
2007
2141
|
|
2008
2142
|
def assert_sass_to_sass(sass, options = {})
|