sass 3.3.0 → 3.4.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (208) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +3 -1
  3. data/CODE_OF_CONDUCT.md +10 -0
  4. data/CONTRIBUTING.md +148 -0
  5. data/MIT-LICENSE +1 -1
  6. data/README.md +76 -62
  7. data/Rakefile +104 -24
  8. data/VERSION +1 -1
  9. data/VERSION_DATE +1 -1
  10. data/VERSION_NAME +1 -1
  11. data/bin/sass +1 -1
  12. data/bin/scss +1 -1
  13. data/extra/sass-spec-ref.sh +32 -0
  14. data/extra/update_watch.rb +1 -1
  15. data/lib/sass/cache_stores/filesystem.rb +9 -5
  16. data/lib/sass/cache_stores/memory.rb +4 -5
  17. data/lib/sass/callbacks.rb +2 -2
  18. data/lib/sass/css.rb +12 -13
  19. data/lib/sass/deprecation.rb +55 -0
  20. data/lib/sass/engine.rb +106 -70
  21. data/lib/sass/environment.rb +39 -19
  22. data/lib/sass/error.rb +17 -20
  23. data/lib/sass/exec/base.rb +199 -0
  24. data/lib/sass/exec/sass_convert.rb +283 -0
  25. data/lib/sass/exec/sass_scss.rb +440 -0
  26. data/lib/sass/exec.rb +5 -771
  27. data/lib/sass/features.rb +9 -2
  28. data/lib/sass/importers/base.rb +8 -3
  29. data/lib/sass/importers/filesystem.rb +30 -38
  30. data/lib/sass/logger/base.rb +8 -2
  31. data/lib/sass/logger/delayed.rb +50 -0
  32. data/lib/sass/logger.rb +8 -3
  33. data/lib/sass/media.rb +1 -4
  34. data/lib/sass/plugin/compiler.rb +224 -90
  35. data/lib/sass/plugin/configuration.rb +38 -22
  36. data/lib/sass/plugin/merb.rb +2 -2
  37. data/lib/sass/plugin/rack.rb +3 -3
  38. data/lib/sass/plugin/rails.rb +1 -1
  39. data/lib/sass/plugin/staleness_checker.rb +4 -4
  40. data/lib/sass/plugin.rb +6 -5
  41. data/lib/sass/script/css_lexer.rb +1 -1
  42. data/lib/sass/script/css_parser.rb +2 -3
  43. data/lib/sass/script/css_variable_warning.rb +52 -0
  44. data/lib/sass/script/functions.rb +739 -318
  45. data/lib/sass/script/lexer.rb +134 -54
  46. data/lib/sass/script/parser.rb +252 -56
  47. data/lib/sass/script/tree/funcall.rb +13 -6
  48. data/lib/sass/script/tree/interpolation.rb +127 -4
  49. data/lib/sass/script/tree/list_literal.rb +31 -4
  50. data/lib/sass/script/tree/literal.rb +4 -0
  51. data/lib/sass/script/tree/node.rb +21 -3
  52. data/lib/sass/script/tree/operation.rb +54 -1
  53. data/lib/sass/script/tree/selector.rb +26 -0
  54. data/lib/sass/script/tree/string_interpolation.rb +59 -38
  55. data/lib/sass/script/tree/variable.rb +1 -1
  56. data/lib/sass/script/tree.rb +1 -0
  57. data/lib/sass/script/value/base.rb +17 -14
  58. data/lib/sass/script/value/bool.rb +0 -5
  59. data/lib/sass/script/value/color.rb +78 -42
  60. data/lib/sass/script/value/helpers.rb +119 -2
  61. data/lib/sass/script/value/list.rb +0 -15
  62. data/lib/sass/script/value/map.rb +1 -1
  63. data/lib/sass/script/value/null.rb +0 -5
  64. data/lib/sass/script/value/number.rb +112 -31
  65. data/lib/sass/script/value/string.rb +102 -13
  66. data/lib/sass/script/value.rb +0 -1
  67. data/lib/sass/script.rb +3 -3
  68. data/lib/sass/scss/css_parser.rb +24 -4
  69. data/lib/sass/scss/parser.rb +290 -383
  70. data/lib/sass/scss/rx.rb +17 -9
  71. data/lib/sass/scss/static_parser.rb +306 -4
  72. data/lib/sass/scss.rb +0 -2
  73. data/lib/sass/selector/abstract_sequence.rb +35 -18
  74. data/lib/sass/selector/comma_sequence.rb +114 -19
  75. data/lib/sass/selector/pseudo.rb +266 -0
  76. data/lib/sass/selector/sequence.rb +146 -40
  77. data/lib/sass/selector/simple.rb +22 -33
  78. data/lib/sass/selector/simple_sequence.rb +122 -39
  79. data/lib/sass/selector.rb +57 -197
  80. data/lib/sass/shared.rb +2 -2
  81. data/lib/sass/source/map.rb +31 -14
  82. data/lib/sass/source/position.rb +4 -4
  83. data/lib/sass/stack.rb +2 -8
  84. data/lib/sass/supports.rb +10 -13
  85. data/lib/sass/tree/at_root_node.rb +1 -0
  86. data/lib/sass/tree/charset_node.rb +1 -1
  87. data/lib/sass/tree/comment_node.rb +1 -1
  88. data/lib/sass/tree/css_import_node.rb +9 -1
  89. data/lib/sass/tree/directive_node.rb +8 -2
  90. data/lib/sass/tree/error_node.rb +18 -0
  91. data/lib/sass/tree/extend_node.rb +1 -1
  92. data/lib/sass/tree/function_node.rb +9 -0
  93. data/lib/sass/tree/import_node.rb +6 -5
  94. data/lib/sass/tree/keyframe_rule_node.rb +15 -0
  95. data/lib/sass/tree/node.rb +5 -3
  96. data/lib/sass/tree/prop_node.rb +6 -7
  97. data/lib/sass/tree/rule_node.rb +26 -11
  98. data/lib/sass/tree/visitors/check_nesting.rb +56 -32
  99. data/lib/sass/tree/visitors/convert.rb +59 -44
  100. data/lib/sass/tree/visitors/cssize.rb +34 -30
  101. data/lib/sass/tree/visitors/deep_copy.rb +6 -1
  102. data/lib/sass/tree/visitors/extend.rb +15 -13
  103. data/lib/sass/tree/visitors/perform.rb +87 -50
  104. data/lib/sass/tree/visitors/set_options.rb +15 -1
  105. data/lib/sass/tree/visitors/to_css.rb +72 -43
  106. data/lib/sass/util/multibyte_string_scanner.rb +0 -2
  107. data/lib/sass/util/normalized_map.rb +0 -1
  108. data/lib/sass/util/subset_map.rb +2 -3
  109. data/lib/sass/util.rb +334 -154
  110. data/lib/sass/version.rb +7 -7
  111. data/lib/sass.rb +10 -8
  112. data/test/sass/cache_test.rb +62 -20
  113. data/test/sass/callbacks_test.rb +1 -1
  114. data/test/sass/compiler_test.rb +24 -11
  115. data/test/sass/conversion_test.rb +241 -50
  116. data/test/sass/css2sass_test.rb +73 -5
  117. data/test/sass/css_variable_test.rb +132 -0
  118. data/test/sass/encoding_test.rb +219 -0
  119. data/test/sass/engine_test.rb +343 -260
  120. data/test/sass/exec_test.rb +12 -2
  121. data/test/sass/extend_test.rb +333 -44
  122. data/test/sass/functions_test.rb +353 -260
  123. data/test/sass/importer_test.rb +40 -21
  124. data/test/sass/logger_test.rb +1 -1
  125. data/test/sass/more_results/more_import.css +1 -1
  126. data/test/sass/more_templates/more1.sass +10 -10
  127. data/test/sass/more_templates/more_import.sass +2 -2
  128. data/test/sass/plugin_test.rb +24 -21
  129. data/test/sass/results/compact.css +1 -1
  130. data/test/sass/results/complex.css +4 -4
  131. data/test/sass/results/expanded.css +1 -1
  132. data/test/sass/results/import.css +1 -1
  133. data/test/sass/results/import_charset_ibm866.css +2 -2
  134. data/test/sass/results/mixins.css +17 -17
  135. data/test/sass/results/nested.css +1 -1
  136. data/test/sass/results/parent_ref.css +2 -2
  137. data/test/sass/results/script.css +5 -5
  138. data/test/sass/results/scss_import.css +1 -1
  139. data/test/sass/script_conversion_test.rb +71 -39
  140. data/test/sass/script_test.rb +714 -123
  141. data/test/sass/scss/css_test.rb +213 -30
  142. data/test/sass/scss/rx_test.rb +8 -4
  143. data/test/sass/scss/scss_test.rb +766 -22
  144. data/test/sass/source_map_test.rb +263 -95
  145. data/test/sass/superselector_test.rb +210 -0
  146. data/test/sass/templates/_partial.sass +1 -1
  147. data/test/sass/templates/basic.sass +10 -10
  148. data/test/sass/templates/bork1.sass +1 -1
  149. data/test/sass/templates/bork5.sass +1 -1
  150. data/test/sass/templates/compact.sass +10 -10
  151. data/test/sass/templates/complex.sass +187 -187
  152. data/test/sass/templates/compressed.sass +10 -10
  153. data/test/sass/templates/expanded.sass +10 -10
  154. data/test/sass/templates/import.sass +2 -2
  155. data/test/sass/templates/importee.sass +3 -3
  156. data/test/sass/templates/mixins.sass +22 -22
  157. data/test/sass/templates/multiline.sass +4 -4
  158. data/test/sass/templates/nested.sass +13 -13
  159. data/test/sass/templates/parent_ref.sass +12 -12
  160. data/test/sass/templates/script.sass +70 -70
  161. data/test/sass/templates/scss_import.scss +2 -1
  162. data/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +1 -1
  163. data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +2 -2
  164. data/test/sass/templates/subdir/subdir.sass +3 -3
  165. data/test/sass/templates/units.sass +10 -10
  166. data/test/sass/test_helper.rb +1 -1
  167. data/test/sass/util/multibyte_string_scanner_test.rb +11 -3
  168. data/test/sass/util/normalized_map_test.rb +1 -1
  169. data/test/sass/util/subset_map_test.rb +2 -2
  170. data/test/sass/util_test.rb +46 -45
  171. data/test/sass/value_helpers_test.rb +5 -7
  172. data/test/sass-spec.yml +3 -0
  173. data/test/test_helper.rb +7 -6
  174. data/vendor/listen/CHANGELOG.md +1 -228
  175. data/vendor/listen/Gemfile +5 -15
  176. data/vendor/listen/README.md +111 -77
  177. data/vendor/listen/Rakefile +0 -42
  178. data/vendor/listen/lib/listen/adapter.rb +195 -82
  179. data/vendor/listen/lib/listen/adapters/bsd.rb +27 -64
  180. data/vendor/listen/lib/listen/adapters/darwin.rb +21 -58
  181. data/vendor/listen/lib/listen/adapters/linux.rb +23 -55
  182. data/vendor/listen/lib/listen/adapters/polling.rb +25 -34
  183. data/vendor/listen/lib/listen/adapters/windows.rb +50 -46
  184. data/vendor/listen/lib/listen/directory_record.rb +96 -61
  185. data/vendor/listen/lib/listen/listener.rb +135 -37
  186. data/vendor/listen/lib/listen/turnstile.rb +9 -5
  187. data/vendor/listen/lib/listen/version.rb +1 -1
  188. data/vendor/listen/lib/listen.rb +33 -19
  189. data/vendor/listen/listen.gemspec +6 -0
  190. data/vendor/listen/spec/listen/adapter_spec.rb +43 -77
  191. data/vendor/listen/spec/listen/adapters/polling_spec.rb +8 -8
  192. data/vendor/listen/spec/listen/directory_record_spec.rb +81 -56
  193. data/vendor/listen/spec/listen/listener_spec.rb +128 -39
  194. data/vendor/listen/spec/listen_spec.rb +15 -21
  195. data/vendor/listen/spec/spec_helper.rb +4 -0
  196. data/vendor/listen/spec/support/adapter_helper.rb +52 -15
  197. data/vendor/listen/spec/support/directory_record_helper.rb +7 -5
  198. data/vendor/listen/spec/support/listeners_helper.rb +30 -7
  199. metadata +310 -300
  200. data/CONTRIBUTING +0 -3
  201. data/ext/mkrf_conf.rb +0 -27
  202. data/lib/sass/script/value/deprecated_false.rb +0 -55
  203. data/lib/sass/scss/script_lexer.rb +0 -15
  204. data/lib/sass/scss/script_parser.rb +0 -25
  205. data/vendor/listen/lib/listen/dependency_manager.rb +0 -126
  206. data/vendor/listen/lib/listen/multi_listener.rb +0 -143
  207. data/vendor/listen/spec/listen/dependency_manager_spec.rb +0 -107
  208. data/vendor/listen/spec/listen/multi_listener_spec.rb +0 -174
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  require File.dirname(__FILE__) + '/../test_helper'
3
3
 
4
- class ConversionTest < Test::Unit::TestCase
4
+ class ConversionTest < MiniTest::Test
5
5
  def test_basic
6
6
  assert_renders <<SASS, <<SCSS
7
7
  foo bar
@@ -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
- assert_scss_to_sass "@media screen", "@media screen {}"
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
- assert_sass_to_scss <<SCSS, <<SASS
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
- SASS
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,27 @@ 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
+
640
+ bar: baz;
641
+ }
642
+ SCSS
643
+ end
644
+
645
+ def test_error
646
+ assert_renders <<SASS, <<SCSS
647
+ foo
648
+ @error "oh no!"
649
+
650
+ bar: baz
651
+ SASS
652
+ foo {
653
+ @error "oh no!";
654
+
587
655
  bar: baz;
588
656
  }
589
657
  SCSS
@@ -593,10 +661,12 @@ SCSS
593
661
  assert_renders <<SASS, <<SCSS
594
662
  foo
595
663
  @foo #bar "baz"
664
+
596
665
  bar: baz
597
666
  SASS
598
667
  foo {
599
668
  @foo #bar "baz";
669
+
600
670
  bar: baz;
601
671
  }
602
672
  SCSS
@@ -628,6 +698,7 @@ foo
628
698
  @foo #bar "baz"
629
699
  #blat
630
700
  a: b
701
+
631
702
  .bang
632
703
  c: d
633
704
  e: f
@@ -639,6 +710,7 @@ foo {
639
710
  #blat {
640
711
  a: b;
641
712
  }
713
+
642
714
  .bang {
643
715
  c: d;
644
716
  e: f;
@@ -655,11 +727,14 @@ SCSS
655
727
  foo
656
728
  @foo #bar "baz"
657
729
  g: h
730
+
658
731
  #blat
659
732
  a: b
733
+
660
734
  .bang
661
735
  c: d
662
736
  e: f
737
+
663
738
  i: j
664
739
 
665
740
  bar: baz
@@ -667,13 +742,16 @@ SASS
667
742
  foo {
668
743
  @foo #bar "baz" {
669
744
  g: h;
745
+
670
746
  #blat {
671
747
  a: b;
672
748
  }
749
+
673
750
  .bang {
674
751
  c: d;
675
752
  e: f;
676
753
  }
754
+
677
755
  i: j;
678
756
  }
679
757
 
@@ -695,6 +773,7 @@ SCSS
695
773
  foo
696
774
  @for $a from $b to $c
697
775
  a: b
776
+
698
777
  @for $c from 1 to 16
699
778
  d: e
700
779
  f: g
@@ -703,6 +782,7 @@ foo {
703
782
  @for $a from $b to $c {
704
783
  a: b;
705
784
  }
785
+
706
786
  @for $c from 1 to 16 {
707
787
  d: e;
708
788
  f: g;
@@ -716,6 +796,7 @@ SCSS
716
796
  foo
717
797
  @while flaz($a + $b)
718
798
  a: b
799
+
719
800
  @while 1
720
801
  d: e
721
802
  f: g
@@ -724,6 +805,7 @@ foo {
724
805
  @while flaz($a + $b) {
725
806
  a: b;
726
807
  }
808
+
727
809
  @while 1 {
728
810
  d: e;
729
811
  f: g;
@@ -737,6 +819,7 @@ SCSS
737
819
  foo
738
820
  @if $foo or $bar
739
821
  a: b
822
+
740
823
  @if $baz
741
824
  d: e
742
825
  @else if $bang
@@ -748,6 +831,7 @@ foo {
748
831
  @if $foo or $bar {
749
832
  a: b;
750
833
  }
834
+
751
835
  @if $baz {
752
836
  d: e;
753
837
  }
@@ -893,10 +977,12 @@ SCSS
893
977
  assert_renders <<SASS, <<SCSS
894
978
  .foo
895
979
  @extend .bar
980
+
896
981
  @extend .baz:bang
897
982
  SASS
898
983
  .foo {
899
984
  @extend .bar;
985
+
900
986
  @extend .baz:bang;
901
987
  }
902
988
  SCSS
@@ -995,10 +1081,12 @@ SASS
995
1081
  assert_renders <<SASS, <<SCSS
996
1082
  foo
997
1083
  +foo-bar
1084
+
998
1085
  a: blip
999
1086
  SASS
1000
1087
  foo {
1001
1088
  @include foo-bar;
1089
+
1002
1090
  a: blip;
1003
1091
  }
1004
1092
  SCSS
@@ -1008,10 +1096,12 @@ SCSS
1008
1096
  assert_renders <<SASS, <<SCSS
1009
1097
  foo
1010
1098
  +foo-bar(12px, "blaz")
1099
+
1011
1100
  a: blip
1012
1101
  SASS
1013
1102
  foo {
1014
1103
  @include foo-bar(12px, "blaz");
1104
+
1015
1105
  a: blip;
1016
1106
  }
1017
1107
  SCSS
@@ -1021,12 +1111,33 @@ SCSS
1021
1111
  assert_renders <<SASS, <<SCSS
1022
1112
  foo
1023
1113
  +foo-bar(12px, "blaz", $blip: blap, $bloop: blop)
1114
+
1024
1115
  +foo-bar($blip: blap, $bloop: blop)
1116
+
1025
1117
  a: blip
1026
1118
  SASS
1027
1119
  foo {
1028
1120
  @include foo-bar(12px, "blaz", $blip: blap, $bloop: blop);
1121
+
1029
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
+
1030
1141
  a: blip;
1031
1142
  }
1032
1143
  SCSS
@@ -1036,10 +1147,12 @@ SCSS
1036
1147
  assert_renders <<SASS, <<SCSS
1037
1148
  foo
1038
1149
  +foo-bar($a-b_c: val)
1150
+
1039
1151
  a: blip
1040
1152
  SASS
1041
1153
  foo {
1042
1154
  @include foo-bar($a-b_c: val);
1155
+
1043
1156
  a: blip;
1044
1157
  }
1045
1158
  SCSS
@@ -1049,10 +1162,12 @@ SCSS
1049
1162
  assert_renders <<SASS, <<SCSS
1050
1163
  @function foo()
1051
1164
  $var: 1 + 1
1165
+
1052
1166
  @return $var
1053
1167
  SASS
1054
1168
  @function foo() {
1055
1169
  $var: 1 + 1;
1170
+
1056
1171
  @return $var;
1057
1172
  }
1058
1173
  SCSS
@@ -1092,12 +1207,14 @@ $var1: 12px + 15px
1092
1207
 
1093
1208
  foo
1094
1209
  $var2: flaz(#abcdef)
1210
+
1095
1211
  val: $var1 $var2
1096
1212
  SASS
1097
1213
  $var1: 12px + 15px;
1098
1214
 
1099
1215
  foo {
1100
1216
  $var2: flaz(#abcdef);
1217
+
1101
1218
  val: $var1 $var2;
1102
1219
  }
1103
1220
  SCSS
@@ -1109,12 +1226,14 @@ $var1: 12px + 15px !default
1109
1226
 
1110
1227
  foo
1111
1228
  $var2: flaz(#abcdef) !default
1229
+
1112
1230
  val: $var1 $var2
1113
1231
  SASS
1114
1232
  $var1: 12px + 15px !default;
1115
1233
 
1116
1234
  foo {
1117
1235
  $var2: flaz(#abcdef) !default;
1236
+
1118
1237
  val: $var1 $var2;
1119
1238
  }
1120
1239
  SCSS
@@ -1194,6 +1313,16 @@ SASS
1194
1313
  foo {
1195
1314
  a: 1px / 2px;
1196
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
+ }
1197
1326
  SCSS
1198
1327
  end
1199
1328
 
@@ -1228,26 +1357,7 @@ SCSS
1228
1357
  end
1229
1358
 
1230
1359
  def test_media_with_expressions
1231
- assert_sass_to_scss <<SCSS, <<SASS
1232
- $media1: screen;
1233
- $media2: print;
1234
- $var: -webkit-min-device-pixel-ratio;
1235
- $val: 20;
1236
-
1237
- @media \#{$media1} and ($var + "-foo": $val + 5), only \#{$media2} {
1238
- a: b;
1239
- }
1240
- SCSS
1241
- $media1: screen
1242
- $media2: print
1243
- $var: -webkit-min-device-pixel-ratio
1244
- $val: 20
1245
-
1246
- @media \#{$media1} and ($var + "-foo": $val + 5), only \#{$media2}
1247
- a: b
1248
- SASS
1249
-
1250
- assert_scss_to_sass <<SASS, <<SCSS
1360
+ assert_renders <<SASS, <<SCSS
1251
1361
  $media1: screen
1252
1362
  $media2: print
1253
1363
  $var: -webkit-min-device-pixel-ratio
@@ -1267,13 +1377,24 @@ $val: 20;
1267
1377
  SCSS
1268
1378
  end
1269
1379
 
1380
+ def test_media_with_feature
1381
+ assert_renders <<SASS, <<SCSS
1382
+ @media screen and (-webkit-transform-3d)
1383
+ a: b
1384
+ SASS
1385
+ @media screen and (-webkit-transform-3d) {
1386
+ a: b;
1387
+ }
1388
+ SCSS
1389
+ end
1390
+
1270
1391
  def test_supports_with_expressions
1271
1392
  assert_renders <<SASS, <<SCSS
1272
1393
  $query: "(feature1: val)"
1273
1394
  $feature: feature2
1274
1395
  $val: val
1275
1396
 
1276
- @supports \#{$query} and ($feature: $val) or (not ($feature + 3: $val + 4))
1397
+ @supports (\#{$query} and ($feature: $val)) or (not ($feature + 3: $val + 4))
1277
1398
  foo
1278
1399
  a: b
1279
1400
  SASS
@@ -1281,7 +1402,7 @@ $query: "(feature1: val)";
1281
1402
  $feature: feature2;
1282
1403
  $val: val;
1283
1404
 
1284
- @supports \#{$query} and ($feature: $val) or (not ($feature + 3: $val + 4)) {
1405
+ @supports (\#{$query} and ($feature: $val)) or (not ($feature + 3: $val + 4)) {
1285
1406
  foo {
1286
1407
  a: b;
1287
1408
  }
@@ -1315,7 +1436,7 @@ SCSS
1315
1436
  end
1316
1437
 
1317
1438
  def test_old_declaration_hacks
1318
- assert_renders <<SASS, <<SCSS, :old => true
1439
+ silence_warnings {assert_renders <<SASS, <<SCSS, :old => true}
1319
1440
  foo
1320
1441
  :_name val
1321
1442
  :*name val
@@ -1390,7 +1511,9 @@ SCSS
1390
1511
 
1391
1512
  div {
1392
1513
  foo: under-scored-fn($under-scored-var + "before\#{$another-under-scored-var}after");
1514
+
1393
1515
  @include under-scored-mixin($passed-arg);
1516
+
1394
1517
  selector-\#{$under-scored-interp}: bold;
1395
1518
  }
1396
1519
 
@@ -1430,7 +1553,9 @@ $color: blue
1430
1553
  =context($class, $color: red)
1431
1554
  .\#{$class}
1432
1555
  background-color: $color
1556
+
1433
1557
  @content
1558
+
1434
1559
  border-color: $color
1435
1560
 
1436
1561
  +context(parent)
@@ -1442,7 +1567,9 @@ $color: blue;
1442
1567
  @mixin context($class, $color: red) {
1443
1568
  .\#{$class} {
1444
1569
  background-color: $color;
1570
+
1445
1571
  @content;
1572
+
1446
1573
  border-color: $color;
1447
1574
  }
1448
1575
  }
@@ -1527,6 +1654,7 @@ foo bar
1527
1654
  baz bang
1528
1655
  baz: bang
1529
1656
  bip: bop
1657
+
1530
1658
  blat: boo
1531
1659
  SASS
1532
1660
  foo bar {
@@ -1534,6 +1662,7 @@ foo bar {
1534
1662
  baz: bang;
1535
1663
  bip: bop;
1536
1664
  }
1665
+
1537
1666
  blat: boo;
1538
1667
  }
1539
1668
  SCSS
@@ -1543,6 +1672,7 @@ foo bar
1543
1672
  baz bang
1544
1673
  baz: bang
1545
1674
  bip: bop
1675
+
1546
1676
  blat: boo
1547
1677
  SASS
1548
1678
  foo bar {
@@ -1550,6 +1680,7 @@ foo bar {
1550
1680
  baz: bang;
1551
1681
  bip: bop;
1552
1682
  }
1683
+
1553
1684
  blat: boo;
1554
1685
  }
1555
1686
  SCSS
@@ -1560,6 +1691,7 @@ foo bar {
1560
1691
  baz: bang;
1561
1692
  bip: bop;
1562
1693
  }
1694
+
1563
1695
  blat: boo;
1564
1696
  }
1565
1697
  SCSS
@@ -1567,6 +1699,7 @@ foo bar
1567
1699
  baz bang
1568
1700
  baz: bang
1569
1701
  bip: bop
1702
+
1570
1703
  blat: boo
1571
1704
  SASS
1572
1705
 
@@ -1576,6 +1709,7 @@ foo bar {
1576
1709
  baz: bang;
1577
1710
  bip: bop;
1578
1711
  }
1712
+
1579
1713
  blat: boo;
1580
1714
  }
1581
1715
  SCSS
@@ -1583,6 +1717,7 @@ foo bar
1583
1717
  baz bang
1584
1718
  baz: bang
1585
1719
  bip: bop
1720
+
1586
1721
  blat: boo
1587
1722
  SASS
1588
1723
 
@@ -1591,6 +1726,7 @@ foo bar
1591
1726
  baz bang
1592
1727
  baz: bang
1593
1728
  bip: bop
1729
+
1594
1730
  blat: boo
1595
1731
  SASS
1596
1732
  foo bar {
@@ -1598,6 +1734,7 @@ foo bar {
1598
1734
  baz: bang;
1599
1735
  bip: bop;
1600
1736
  }
1737
+
1601
1738
  blat: boo;
1602
1739
  }
1603
1740
  SCSS
@@ -1607,6 +1744,7 @@ foo bar
1607
1744
  baz bang
1608
1745
  baz: bang
1609
1746
  bip: bop
1747
+
1610
1748
  blat: boo
1611
1749
  SASS
1612
1750
  foo bar {
@@ -1614,13 +1752,14 @@ foo bar {
1614
1752
  baz: bang;
1615
1753
  bip: bop;
1616
1754
  }
1755
+
1617
1756
  blat: boo;
1618
1757
  }
1619
1758
  SCSS
1620
1759
  end
1621
1760
 
1622
1761
  def test_extend_with_optional
1623
- assert_scss_to_sass <<SASS, <<SCSS
1762
+ assert_renders <<SASS, <<SCSS
1624
1763
  foo
1625
1764
  @extend .bar !optional
1626
1765
  SASS
@@ -1631,7 +1770,7 @@ SCSS
1631
1770
  end
1632
1771
 
1633
1772
  def test_mixin_var_args
1634
- assert_scss_to_sass <<SASS, <<SCSS
1773
+ assert_renders <<SASS, <<SCSS
1635
1774
  =foo($args...)
1636
1775
  a: b
1637
1776
 
@@ -1640,6 +1779,7 @@ SCSS
1640
1779
 
1641
1780
  .foo
1642
1781
  +foo($list...)
1782
+
1643
1783
  +bar(1, $list...)
1644
1784
  SASS
1645
1785
  @mixin foo($args...) {
@@ -1652,19 +1792,21 @@ SASS
1652
1792
 
1653
1793
  .foo {
1654
1794
  @include foo($list...);
1795
+
1655
1796
  @include bar(1, $list...);
1656
1797
  }
1657
1798
  SCSS
1658
1799
  end
1659
1800
 
1660
1801
  def test_mixin_var_kwargs
1661
- assert_scss_to_sass <<SASS, <<SCSS
1802
+ assert_renders <<SASS, <<SCSS
1662
1803
  =foo($a: b, $c: d)
1663
1804
  a: $a
1664
1805
  c: $c
1665
1806
 
1666
1807
  .foo
1667
1808
  +foo($list..., $map...)
1809
+
1668
1810
  +foo(pos, $list..., $kwd: val, $map...)
1669
1811
  SASS
1670
1812
  @mixin foo($a: b, $c: d) {
@@ -1674,13 +1816,14 @@ SASS
1674
1816
 
1675
1817
  .foo {
1676
1818
  @include foo($list..., $map...);
1819
+
1677
1820
  @include foo(pos, $list..., $kwd: val, $map...);
1678
1821
  }
1679
1822
  SCSS
1680
1823
  end
1681
1824
 
1682
1825
  def test_function_var_args
1683
- assert_scss_to_sass <<SASS, <<SCSS
1826
+ assert_renders <<SASS, <<SCSS
1684
1827
  @function foo($args...)
1685
1828
  @return foo
1686
1829
 
@@ -1707,7 +1850,7 @@ SCSS
1707
1850
  end
1708
1851
 
1709
1852
  def test_function_var_kwargs
1710
- assert_scss_to_sass <<SASS, <<SCSS
1853
+ assert_renders <<SASS, <<SCSS
1711
1854
  @function foo($a: b, $c: d)
1712
1855
  @return foo
1713
1856
 
@@ -1727,11 +1870,12 @@ SCSS
1727
1870
  end
1728
1871
 
1729
1872
  def test_at_root
1730
- assert_scss_to_sass <<SASS, <<SCSS
1873
+ assert_renders <<SASS, <<SCSS
1731
1874
  .foo
1732
1875
  @at-root
1733
1876
  .bar
1734
1877
  a: b
1878
+
1735
1879
  .baz
1736
1880
  c: d
1737
1881
  SASS
@@ -1740,6 +1884,7 @@ SASS
1740
1884
  .bar {
1741
1885
  a: b;
1742
1886
  }
1887
+
1743
1888
  .baz {
1744
1889
  c: d;
1745
1890
  }
@@ -1749,7 +1894,7 @@ SCSS
1749
1894
  end
1750
1895
 
1751
1896
  def test_at_root_with_selector
1752
- assert_scss_to_sass <<SASS, <<SCSS
1897
+ assert_renders <<SASS, <<SCSS
1753
1898
  .foo
1754
1899
  @at-root .bar
1755
1900
  a: b
@@ -1763,7 +1908,7 @@ SCSS
1763
1908
  end
1764
1909
 
1765
1910
  def test_at_root_without
1766
- assert_scss_to_sass <<SASS, <<SCSS
1911
+ assert_renders <<SASS, <<SCSS
1767
1912
  .foo
1768
1913
  @at-root (without: media rule)
1769
1914
  a: b
@@ -1777,7 +1922,7 @@ SCSS
1777
1922
  end
1778
1923
 
1779
1924
  def test_at_root_with
1780
- assert_scss_to_sass <<SASS, <<SCSS
1925
+ assert_renders <<SASS, <<SCSS
1781
1926
  .foo
1782
1927
  @at-root (with: media rule)
1783
1928
  a: b
@@ -1791,7 +1936,7 @@ SCSS
1791
1936
  end
1792
1937
 
1793
1938
  def test_function_var_kwargs_with_list
1794
- assert_scss_to_sass <<SASS, <<SCSS
1939
+ assert_renders <<SASS, <<SCSS
1795
1940
  @function foo($a: b, $c: d)
1796
1941
  @return $a, $c
1797
1942
 
@@ -1808,6 +1953,45 @@ SASS
1808
1953
  SCSS
1809
1954
  end
1810
1955
 
1956
+ def test_keyframes
1957
+ assert_renders(<<SASS, <<SCSS)
1958
+ @keyframes identifier
1959
+ 0%
1960
+ top: 0
1961
+ left: 0
1962
+
1963
+ 30%
1964
+ top: 50px
1965
+
1966
+ 68%, 72%
1967
+ left: 50px
1968
+
1969
+ 100%
1970
+ top: 100px
1971
+ left: 100%
1972
+ SASS
1973
+ @keyframes identifier {
1974
+ 0% {
1975
+ top: 0;
1976
+ left: 0;
1977
+ }
1978
+
1979
+ 30% {
1980
+ top: 50px;
1981
+ }
1982
+
1983
+ 68%, 72% {
1984
+ left: 50px;
1985
+ }
1986
+
1987
+ 100% {
1988
+ top: 100px;
1989
+ left: 100%;
1990
+ }
1991
+ }
1992
+ SCSS
1993
+ end
1994
+
1811
1995
  ## Regression Tests
1812
1996
 
1813
1997
  def test_list_in_args
@@ -1827,12 +2011,13 @@ SCSS
1827
2011
  end
1828
2012
 
1829
2013
  def test_media_query_with_expr
1830
- assert_scss_to_sass <<SASS, <<SCSS
2014
+ assert_renders <<SASS, <<SCSS
1831
2015
  @media foo and (bar: baz)
1832
2016
  a: b
1833
2017
  SASS
1834
2018
  @media foo and (bar: baz) {
1835
- a: b; }
2019
+ a: b;
2020
+ }
1836
2021
  SCSS
1837
2022
  end
1838
2023
 
@@ -1918,13 +2103,11 @@ foo
1918
2103
  ok: -$foo
1919
2104
  comma: 10px, -$foo
1920
2105
  needs-parens: 10px (-$foo)
1921
- no-parens: a 50px + 60px b
1922
2106
  SASS
1923
2107
  foo {
1924
2108
  ok: -$foo;
1925
2109
  comma: 10px, -$foo;
1926
2110
  needs-parens: 10px (-$foo);
1927
- no-parens: a 50px + 60px b;
1928
2111
  }
1929
2112
  SCSS
1930
2113
  end
@@ -1946,6 +2129,14 @@ foo {
1946
2129
  SCSS
1947
2130
  end
1948
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
+
1949
2140
  private
1950
2141
 
1951
2142
  def assert_sass_to_sass(sass, options = {})