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
data/test/sass/engine_test.rb
CHANGED
@@ -2588,6 +2588,13 @@ a > b, c + d, :-moz-any(e, f, g)
|
|
2588
2588
|
SASS
|
2589
2589
|
end
|
2590
2590
|
|
2591
|
+
def test_comment_like_selector
|
2592
|
+
assert_raise_message(Sass::SyntaxError, 'Invalid CSS after "": expected selector, was "/ foo"') {render(<<SASS)}
|
2593
|
+
/ foo
|
2594
|
+
a: b
|
2595
|
+
SASS
|
2596
|
+
end
|
2597
|
+
|
2591
2598
|
# Encodings
|
2592
2599
|
|
2593
2600
|
unless Sass::Util.ruby1_8?
|
data/test/sass/extend_test.rb
CHANGED
@@ -876,6 +876,20 @@ CSS
|
|
876
876
|
SCSS
|
877
877
|
end
|
878
878
|
|
879
|
+
def test_comma_extendee
|
880
|
+
assert_equal <<CSS, render(<<SCSS)
|
881
|
+
.foo, .baz {
|
882
|
+
a: b; }
|
883
|
+
|
884
|
+
.bar, .baz {
|
885
|
+
c: d; }
|
886
|
+
CSS
|
887
|
+
.foo {a: b}
|
888
|
+
.bar {c: d}
|
889
|
+
.baz {@extend .foo, .bar}
|
890
|
+
SCSS
|
891
|
+
end
|
892
|
+
|
879
893
|
## Long Extendees
|
880
894
|
|
881
895
|
def test_long_extendee
|
data/test/sass/functions_test.rb
CHANGED
@@ -157,15 +157,15 @@ class SassFunctionTest < Test::Unit::TestCase
|
|
157
157
|
def test_rgb
|
158
158
|
assert_equal("#123456", evaluate("rgb(18, 52, 86)"))
|
159
159
|
assert_equal("#beaded", evaluate("rgb(190, 173, 237)"))
|
160
|
-
assert_equal("
|
161
|
-
assert_equal("
|
160
|
+
assert_equal("springgreen", evaluate("rgb(0, 255, 127)"))
|
161
|
+
assert_equal("springgreen", evaluate("rgb($red: 0, $green: 255, $blue: 127)"))
|
162
162
|
end
|
163
163
|
|
164
164
|
def test_rgb_percent
|
165
165
|
assert_equal("#123456", evaluate("rgb(7.1%, 20.4%, 34%)"))
|
166
166
|
assert_equal("#beaded", evaluate("rgb(74.7%, 173, 93%)"))
|
167
167
|
assert_equal("#beaded", evaluate("rgb(190, 68%, 237)"))
|
168
|
-
assert_equal("
|
168
|
+
assert_equal("springgreen", evaluate("rgb(0%, 100%, 50%)"))
|
169
169
|
end
|
170
170
|
|
171
171
|
def test_rgb_tests_bounds
|
@@ -735,6 +735,13 @@ class SassFunctionTest < Test::Unit::TestCase
|
|
735
735
|
"change-color(blue, $lightness: 10%, $red: 120)");
|
736
736
|
end
|
737
737
|
|
738
|
+
def test_ie_hex_str
|
739
|
+
assert_equal("#FFAA11CC", evaluate('ie-hex-str(#aa11cc)'))
|
740
|
+
assert_equal("#FFAA11CC", evaluate('ie-hex-str(#a1c)'))
|
741
|
+
assert_equal("#FFAA11CC", evaluate('ie-hex-str(#A1c)'))
|
742
|
+
assert_equal("#80FF0000", evaluate('ie-hex-str(rgba(255, 0, 0, 0.5))'))
|
743
|
+
end
|
744
|
+
|
738
745
|
def test_mix
|
739
746
|
assert_equal("#7f007f", evaluate("mix(#f00, #00f)"))
|
740
747
|
assert_equal("#7f7f7f", evaluate("mix(#f00, #0ff)"))
|
@@ -772,6 +779,9 @@ class SassFunctionTest < Test::Unit::TestCase
|
|
772
779
|
assert_equal("white", evaluate("grayscale(white)"))
|
773
780
|
assert_equal("black", evaluate("grayscale(black)"))
|
774
781
|
assert_equal("black", evaluate("grayscale($color: black)"))
|
782
|
+
|
783
|
+
assert_equal("grayscale(2)", evaluate("grayscale(2)"))
|
784
|
+
assert_equal("grayscale(-5px)", evaluate("grayscale(-5px)"))
|
775
785
|
end
|
776
786
|
|
777
787
|
def tets_grayscale_tests_types
|
@@ -13,7 +13,8 @@ $var2: $var1 + 7px;
|
|
13
13
|
$var3: fizz;
|
14
14
|
|
15
15
|
foo {
|
16
|
-
prop: $var1 $var2 $var3;
|
16
|
+
prop: $var1 $var2 $var3;
|
17
|
+
}
|
17
18
|
SCSS
|
18
19
|
@var1: 2px 3px;
|
19
20
|
@var2: @var1 + 7px;
|
@@ -28,11 +29,13 @@ LESS
|
|
28
29
|
assert_renders <<SCSS, <<LESS
|
29
30
|
.foo {
|
30
31
|
$var: 2px;
|
31
|
-
prop: $var;
|
32
|
+
prop: $var;
|
33
|
+
}
|
32
34
|
SCSS
|
33
35
|
.foo {
|
34
36
|
@var: 2px;
|
35
|
-
prop: @var;
|
37
|
+
prop: @var;
|
38
|
+
}
|
36
39
|
LESS
|
37
40
|
end
|
38
41
|
|
@@ -64,7 +67,8 @@ LESS
|
|
64
67
|
|
65
68
|
.baz {
|
66
69
|
@extend .foo;
|
67
|
-
@include bar;
|
70
|
+
@include bar;
|
71
|
+
}
|
68
72
|
SCSS
|
69
73
|
@import "#{path}";
|
70
74
|
|
@@ -77,7 +81,8 @@ LESS
|
|
77
81
|
def test_element_selector
|
78
82
|
assert_renders <<SCSS, <<LESS
|
79
83
|
foo {
|
80
|
-
a: b;
|
84
|
+
a: b;
|
85
|
+
}
|
81
86
|
SCSS
|
82
87
|
foo {a: b}
|
83
88
|
LESS
|
@@ -86,7 +91,8 @@ LESS
|
|
86
91
|
def test_class_selector
|
87
92
|
assert_renders <<SCSS, <<LESS
|
88
93
|
.foo {
|
89
|
-
a: b;
|
94
|
+
a: b;
|
95
|
+
}
|
90
96
|
SCSS
|
91
97
|
.foo {a: b}
|
92
98
|
LESS
|
@@ -95,7 +101,8 @@ LESS
|
|
95
101
|
def test_id_selector
|
96
102
|
assert_renders <<SCSS, <<LESS
|
97
103
|
#foo {
|
98
|
-
a: b;
|
104
|
+
a: b;
|
105
|
+
}
|
99
106
|
SCSS
|
100
107
|
#foo {a: b}
|
101
108
|
LESS
|
@@ -104,7 +111,8 @@ LESS
|
|
104
111
|
def test_pseudoclass_selector
|
105
112
|
assert_renders <<SCSS, <<LESS
|
106
113
|
:foo {
|
107
|
-
a: b;
|
114
|
+
a: b;
|
115
|
+
}
|
108
116
|
SCSS
|
109
117
|
:foo {a: b}
|
110
118
|
LESS
|
@@ -113,7 +121,8 @@ LESS
|
|
113
121
|
def test_pseudoelement_selector
|
114
122
|
assert_renders <<SCSS, <<LESS
|
115
123
|
::foo {
|
116
|
-
a: b;
|
124
|
+
a: b;
|
125
|
+
}
|
117
126
|
SCSS
|
118
127
|
::foo {a: b}
|
119
128
|
LESS
|
@@ -122,7 +131,8 @@ LESS
|
|
122
131
|
def test_comma_selector
|
123
132
|
assert_renders <<SCSS, <<LESS
|
124
133
|
foo, .bar .baz, :bang {
|
125
|
-
a: b;
|
134
|
+
a: b;
|
135
|
+
}
|
126
136
|
SCSS
|
127
137
|
foo, .bar .baz, :bang {a: b}
|
128
138
|
LESS
|
@@ -132,17 +142,21 @@ LESS
|
|
132
142
|
assert_renders <<SCSS, <<LESS
|
133
143
|
foo bar, .baz {
|
134
144
|
.bang, &:bip bap {
|
135
|
-
a: b;
|
145
|
+
a: b;
|
146
|
+
}
|
147
|
+
}
|
136
148
|
SCSS
|
137
149
|
foo bar, .baz {
|
138
|
-
.bang, :bip bap {a: b}
|
150
|
+
.bang, :bip bap {a: b}
|
151
|
+
}
|
139
152
|
LESS
|
140
153
|
end
|
141
154
|
|
142
155
|
def test_simple_selector_sequence
|
143
156
|
assert_renders <<SCSS, <<LESS
|
144
157
|
a.foo#bar[attr=val] {
|
145
|
-
a: b;
|
158
|
+
a: b;
|
159
|
+
}
|
146
160
|
SCSS
|
147
161
|
a.foo#bar[attr=val] {a: b}
|
148
162
|
LESS
|
@@ -151,7 +165,8 @@ LESS
|
|
151
165
|
def test_descendant_selector
|
152
166
|
assert_renders <<SCSS, <<LESS
|
153
167
|
.foo .bar {
|
154
|
-
a: b;
|
168
|
+
a: b;
|
169
|
+
}
|
155
170
|
SCSS
|
156
171
|
.foo .bar {a: b}
|
157
172
|
LESS
|
@@ -160,7 +175,8 @@ LESS
|
|
160
175
|
def test_child_selector
|
161
176
|
assert_renders <<SCSS, <<LESS
|
162
177
|
.foo > .bar {
|
163
|
-
a: b;
|
178
|
+
a: b;
|
179
|
+
}
|
164
180
|
SCSS
|
165
181
|
.foo > .bar {a: b}
|
166
182
|
LESS
|
@@ -169,7 +185,8 @@ LESS
|
|
169
185
|
def test_adjacent_selector
|
170
186
|
assert_renders <<SCSS, <<LESS
|
171
187
|
.foo + .bar {
|
172
|
-
a: b;
|
188
|
+
a: b;
|
189
|
+
}
|
173
190
|
SCSS
|
174
191
|
.foo + .bar {a: b}
|
175
192
|
LESS
|
@@ -178,7 +195,8 @@ LESS
|
|
178
195
|
def test_pseudoclass_in_sequence
|
179
196
|
assert_renders <<SCSS, <<LESS
|
180
197
|
.foo:bar {
|
181
|
-
a: b;
|
198
|
+
a: b;
|
199
|
+
}
|
182
200
|
SCSS
|
183
201
|
.foo:bar {a: b}
|
184
202
|
LESS
|
@@ -187,7 +205,8 @@ LESS
|
|
187
205
|
def test_pseudoelement_in_sequence
|
188
206
|
assert_renders <<SCSS, <<LESS
|
189
207
|
.foo::bar {
|
190
|
-
a: b;
|
208
|
+
a: b;
|
209
|
+
}
|
191
210
|
SCSS
|
192
211
|
.foo::bar {a: b}
|
193
212
|
LESS
|
@@ -198,7 +217,8 @@ LESS
|
|
198
217
|
def test_space_separated_props
|
199
218
|
assert_renders <<SCSS, <<LESS
|
200
219
|
foo {
|
201
|
-
a: foo bar baz;
|
220
|
+
a: foo bar baz;
|
221
|
+
}
|
202
222
|
SCSS
|
203
223
|
foo {a: foo bar baz}
|
204
224
|
LESS
|
@@ -207,7 +227,8 @@ LESS
|
|
207
227
|
def test_comma_separated_props
|
208
228
|
assert_renders <<SCSS, <<LESS
|
209
229
|
foo {
|
210
|
-
a: foo, bar, baz;
|
230
|
+
a: foo, bar, baz;
|
231
|
+
}
|
211
232
|
SCSS
|
212
233
|
foo {a: foo, bar, baz}
|
213
234
|
LESS
|
@@ -216,7 +237,8 @@ LESS
|
|
216
237
|
def test_numbers
|
217
238
|
assert_renders <<SCSS, <<LESS
|
218
239
|
foo {
|
219
|
-
a: 1 2.3 -8 5px 3%;
|
240
|
+
a: 1 2.3 -8 5px 3%;
|
241
|
+
}
|
220
242
|
SCSS
|
221
243
|
foo {a: 1 2.3 -8 5px 3%}
|
222
244
|
LESS
|
@@ -225,7 +247,8 @@ LESS
|
|
225
247
|
def test_colors
|
226
248
|
assert_renders <<SCSS, <<LESS
|
227
249
|
foo {
|
228
|
-
a: red #abcdef blue;
|
250
|
+
a: red #abcdef blue;
|
251
|
+
}
|
229
252
|
SCSS
|
230
253
|
foo {a: #f00 #abcdef blue}
|
231
254
|
LESS
|
@@ -234,7 +257,8 @@ LESS
|
|
234
257
|
def test_strings
|
235
258
|
assert_renders <<SCSS, <<LESS
|
236
259
|
foo {
|
237
|
-
a: "foo @var bar" "baz bang" "quote'quote" 'quote"quote';
|
260
|
+
a: "foo @var bar" "baz bang" "quote'quote" 'quote"quote';
|
261
|
+
}
|
238
262
|
SCSS
|
239
263
|
foo {a: "foo @var bar" 'baz bang' "quote'quote" 'quote"quote'}
|
240
264
|
LESS
|
@@ -245,12 +269,14 @@ LESS
|
|
245
269
|
foo {
|
246
270
|
a: small/8px 7em/8px;
|
247
271
|
b: 8/4;
|
248
|
-
c: (8 / 4);
|
272
|
+
c: (8 / 4);
|
273
|
+
}
|
249
274
|
SCSS
|
250
275
|
foo {
|
251
276
|
a: small/8px 7em/8px;
|
252
277
|
b: 8/4;
|
253
|
-
c: 8 / 4;
|
278
|
+
c: 8 / 4;
|
279
|
+
}
|
254
280
|
LESS
|
255
281
|
end
|
256
282
|
|
@@ -259,12 +285,14 @@ LESS
|
|
259
285
|
foo {
|
260
286
|
a: url("http://foobar.com/fizzle.html?foo=bar&bar=baz");
|
261
287
|
b: url("http://foobar.com/fizzle.html?foo=bar&bar=baz");
|
262
|
-
c: url("http://foobar.com/fizzle.html?foo=bar&bar=baz");
|
288
|
+
c: url("http://foobar.com/fizzle.html?foo=bar&bar=baz");
|
289
|
+
}
|
263
290
|
SCSS
|
264
291
|
foo {
|
265
292
|
a: url(http://foobar.com/fizzle.html?foo=bar&bar=baz);
|
266
293
|
b: url("http://foobar.com/fizzle.html?foo=bar&bar=baz");
|
267
|
-
c: url('http://foobar.com/fizzle.html?foo=bar&bar=baz');
|
294
|
+
c: url('http://foobar.com/fizzle.html?foo=bar&bar=baz');
|
295
|
+
}
|
268
296
|
LESS
|
269
297
|
end
|
270
298
|
|
@@ -272,11 +300,13 @@ LESS
|
|
272
300
|
assert_renders <<SCSS, <<LESS
|
273
301
|
foo {
|
274
302
|
a: baz(12px) rgba(80, 70 120, 0.76);
|
275
|
-
b: faz(1px + 3px) bang($var, #aaaaaa * 3);
|
303
|
+
b: faz(1px + 3px) bang($var, #aaaaaa * 3);
|
304
|
+
}
|
276
305
|
SCSS
|
277
306
|
foo {
|
278
307
|
a: baz(12px) rgba(80, 70 120, 0.76);
|
279
|
-
b: faz(1px + 3px) bang(@var, #aaa * 3);
|
308
|
+
b: faz(1px + 3px) bang(@var, #aaa * 3);
|
309
|
+
}
|
280
310
|
LESS
|
281
311
|
end
|
282
312
|
|
@@ -284,18 +314,21 @@ LESS
|
|
284
314
|
assert_renders <<SCSS, <<LESS
|
285
315
|
foo {
|
286
316
|
a: alpha(opacity=2px);
|
287
|
-
b: alpha(opacity = $var);
|
317
|
+
b: alpha(opacity = $var);
|
318
|
+
}
|
288
319
|
SCSS
|
289
320
|
foo {
|
290
321
|
a: alpha(opacity=2px);
|
291
|
-
b: alpha(opacity=@var);
|
322
|
+
b: alpha(opacity=@var);
|
323
|
+
}
|
292
324
|
LESS
|
293
325
|
end
|
294
326
|
|
295
327
|
def test_variables
|
296
328
|
assert_renders <<SCSS, <<LESS
|
297
329
|
foo {
|
298
|
-
a: $var1 $var-foo;
|
330
|
+
a: $var1 $var-foo;
|
331
|
+
}
|
299
332
|
SCSS
|
300
333
|
foo {a: @var1 @var-foo}
|
301
334
|
LESS
|
@@ -307,13 +340,15 @@ foo {
|
|
307
340
|
a: 1px + 2px;
|
308
341
|
b: #bbaa88 - #aa1122;
|
309
342
|
c: 5 * 3;
|
310
|
-
d: (8 / 4);
|
343
|
+
d: (8 / 4);
|
344
|
+
}
|
311
345
|
SCSS
|
312
346
|
foo {
|
313
347
|
a: 1px + 2px;
|
314
348
|
b: #ba8 - #a12;
|
315
349
|
c: 5 * 3;
|
316
|
-
d: 8 / 4;
|
350
|
+
d: 8 / 4;
|
351
|
+
}
|
317
352
|
LESS
|
318
353
|
end
|
319
354
|
|
@@ -333,7 +368,8 @@ foo {
|
|
333
368
|
k: 1 + 2 - (3 + 4);
|
334
369
|
l: 1 / (2 - 3) / 4;
|
335
370
|
m: (1 - 2) / (3 - 4);
|
336
|
-
n: 1 / (2 * 3) / 4;
|
371
|
+
n: 1 / (2 * 3) / 4;
|
372
|
+
}
|
337
373
|
SCSS
|
338
374
|
foo {
|
339
375
|
a: 1 + 2 * 3 + 4;
|
@@ -349,7 +385,8 @@ foo {
|
|
349
385
|
k: 1 + 2 - (3 + 4);
|
350
386
|
l: 1 / (2 - 3) / 4;
|
351
387
|
m: (1 - 2) / (3 - 4);
|
352
|
-
n: 1 / (2 * 3) / 4;
|
388
|
+
n: 1 / (2 * 3) / 4;
|
389
|
+
}
|
353
390
|
LESS
|
354
391
|
end
|
355
392
|
|
@@ -357,18 +394,21 @@ LESS
|
|
357
394
|
assert_renders <<SCSS, <<LESS
|
358
395
|
foo {
|
359
396
|
a: 1px + 2px * 3;
|
360
|
-
b: (1px - 2px) / 3;
|
397
|
+
b: (1px - 2px) / 3;
|
398
|
+
}
|
361
399
|
SCSS
|
362
400
|
foo {
|
363
401
|
a: 1px + (2px * 3);
|
364
|
-
b: (1px - (2px)) / 3;
|
402
|
+
b: (1px - (2px)) / 3;
|
403
|
+
}
|
365
404
|
LESS
|
366
405
|
end
|
367
406
|
|
368
407
|
def test_unary_minus
|
369
408
|
assert_renders <<SCSS, <<LESS
|
370
409
|
foo {
|
371
|
-
a: 1px + -3px;
|
410
|
+
a: 1px + -3px;
|
411
|
+
}
|
372
412
|
SCSS
|
373
413
|
foo {a: 1px + (- 3px)}
|
374
414
|
LESS
|
@@ -379,7 +419,8 @@ LESS
|
|
379
419
|
def test_single_nested_rule
|
380
420
|
assert_renders <<SCSS, <<LESS
|
381
421
|
foo bar {
|
382
|
-
a: b;
|
422
|
+
a: b;
|
423
|
+
}
|
383
424
|
SCSS
|
384
425
|
foo {bar {a: b}}
|
385
426
|
LESS
|
@@ -389,14 +430,17 @@ LESS
|
|
389
430
|
assert_renders <<SCSS, <<LESS
|
390
431
|
foo {
|
391
432
|
bar {
|
392
|
-
a: b;
|
433
|
+
a: b;
|
434
|
+
}
|
393
435
|
c: d;
|
394
|
-
e: f;
|
436
|
+
e: f;
|
437
|
+
}
|
395
438
|
SCSS
|
396
439
|
foo {
|
397
440
|
bar {a: b}
|
398
441
|
c: d;
|
399
|
-
e: f;
|
442
|
+
e: f;
|
443
|
+
}
|
400
444
|
LESS
|
401
445
|
end
|
402
446
|
|
@@ -404,13 +448,17 @@ LESS
|
|
404
448
|
assert_renders <<SCSS, <<LESS
|
405
449
|
foo {
|
406
450
|
bar {
|
407
|
-
a: b;
|
451
|
+
a: b;
|
452
|
+
}
|
408
453
|
baz {
|
409
|
-
c: d;
|
454
|
+
c: d;
|
455
|
+
}
|
456
|
+
}
|
410
457
|
SCSS
|
411
458
|
foo {
|
412
459
|
bar {a: b}
|
413
|
-
baz {c: d}
|
460
|
+
baz {c: d}
|
461
|
+
}
|
414
462
|
LESS
|
415
463
|
end
|
416
464
|
|
@@ -418,17 +466,21 @@ LESS
|
|
418
466
|
assert_renders <<SCSS, <<LESS
|
419
467
|
foo {
|
420
468
|
bar {
|
421
|
-
a: b;
|
469
|
+
a: b;
|
470
|
+
}
|
422
471
|
baz {
|
423
|
-
c: d;
|
472
|
+
c: d;
|
473
|
+
}
|
424
474
|
e: f;
|
425
|
-
g: h;
|
475
|
+
g: h;
|
476
|
+
}
|
426
477
|
SCSS
|
427
478
|
foo {
|
428
479
|
bar {a: b}
|
429
480
|
baz {c: d}
|
430
481
|
e: f;
|
431
|
-
g: h;
|
482
|
+
g: h;
|
483
|
+
}
|
432
484
|
LESS
|
433
485
|
end
|
434
486
|
|
@@ -436,13 +488,17 @@ LESS
|
|
436
488
|
assert_renders <<SCSS, <<LESS
|
437
489
|
foo {
|
438
490
|
> bar {
|
439
|
-
a: b;
|
491
|
+
a: b;
|
492
|
+
}
|
440
493
|
+ baz {
|
441
|
-
c: d;
|
494
|
+
c: d;
|
495
|
+
}
|
496
|
+
}
|
442
497
|
SCSS
|
443
498
|
foo {
|
444
499
|
> bar {a: b}
|
445
|
-
+ baz {c: d}
|
500
|
+
+ baz {c: d}
|
501
|
+
}
|
446
502
|
LESS
|
447
503
|
end
|
448
504
|
|
@@ -450,13 +506,17 @@ LESS
|
|
450
506
|
assert_renders <<SCSS, <<LESS
|
451
507
|
foo {
|
452
508
|
&:bar {
|
453
|
-
a: b;
|
509
|
+
a: b;
|
510
|
+
}
|
454
511
|
&::baz {
|
455
|
-
c: d;
|
512
|
+
c: d;
|
513
|
+
}
|
514
|
+
}
|
456
515
|
SCSS
|
457
516
|
foo {
|
458
517
|
:bar {a: b}
|
459
|
-
::baz {c: d}
|
518
|
+
::baz {c: d}
|
519
|
+
}
|
460
520
|
LESS
|
461
521
|
end
|
462
522
|
|
@@ -465,10 +525,12 @@ LESS
|
|
465
525
|
def test_class_inheritance
|
466
526
|
assert_renders <<SCSS, <<LESS
|
467
527
|
.foo {
|
468
|
-
a: b;
|
528
|
+
a: b;
|
529
|
+
}
|
469
530
|
|
470
531
|
.bar {
|
471
|
-
@extend .foo;
|
532
|
+
@extend .foo;
|
533
|
+
}
|
472
534
|
SCSS
|
473
535
|
.foo {a: b}
|
474
536
|
.bar {.foo;}
|
@@ -478,14 +540,17 @@ LESS
|
|
478
540
|
def test_multiple_class_inheritance
|
479
541
|
assert_renders <<SCSS, <<LESS
|
480
542
|
.foo {
|
481
|
-
a: b;
|
543
|
+
a: b;
|
544
|
+
}
|
482
545
|
|
483
546
|
.bar {
|
484
|
-
c: d;
|
547
|
+
c: d;
|
548
|
+
}
|
485
549
|
|
486
550
|
.baz {
|
487
551
|
@extend .foo;
|
488
|
-
@extend .bar;
|
552
|
+
@extend .bar;
|
553
|
+
}
|
489
554
|
SCSS
|
490
555
|
.foo {a: b}
|
491
556
|
.bar {c: d}
|
@@ -496,10 +561,12 @@ LESS
|
|
496
561
|
def test_pseudoclass_inheritance
|
497
562
|
assert_renders <<SCSS, <<LESS
|
498
563
|
:foo {
|
499
|
-
a: b;
|
564
|
+
a: b;
|
565
|
+
}
|
500
566
|
|
501
567
|
:bar {
|
502
|
-
@extend :foo;
|
568
|
+
@extend :foo;
|
569
|
+
}
|
503
570
|
SCSS
|
504
571
|
:foo {a: b}
|
505
572
|
:bar {:foo;}
|
@@ -509,10 +576,12 @@ LESS
|
|
509
576
|
def test_multiple_pseudoclass_inheritance
|
510
577
|
assert_renders <<SCSS, <<LESS
|
511
578
|
:foo:bar {
|
512
|
-
a: b;
|
579
|
+
a: b;
|
580
|
+
}
|
513
581
|
|
514
582
|
:baz {
|
515
|
-
@extend :foo:bar;
|
583
|
+
@extend :foo:bar;
|
584
|
+
}
|
516
585
|
SCSS
|
517
586
|
:foo:bar {a: b}
|
518
587
|
:baz {:foo:bar;}
|
@@ -522,10 +591,12 @@ LESS
|
|
522
591
|
def test_abstract_mixin
|
523
592
|
assert_renders <<SCSS, <<LESS
|
524
593
|
@mixin foo {
|
525
|
-
a: b;
|
594
|
+
a: b;
|
595
|
+
}
|
526
596
|
|
527
597
|
.bar {
|
528
|
-
@include foo;
|
598
|
+
@include foo;
|
599
|
+
}
|
529
600
|
SCSS
|
530
601
|
.foo() {a: b}
|
531
602
|
.bar {.foo;}
|
@@ -535,10 +606,12 @@ LESS
|
|
535
606
|
def test_mixin_with_args
|
536
607
|
assert_renders <<SCSS, <<LESS
|
537
608
|
@mixin foo($a: 2px, $b: red) {
|
538
|
-
a: $a;
|
609
|
+
a: $a;
|
610
|
+
}
|
539
611
|
|
540
612
|
.bar {
|
541
|
-
@include foo;
|
613
|
+
@include foo;
|
614
|
+
}
|
542
615
|
SCSS
|
543
616
|
.foo(@a: 2px, @b: #f00) {a: @a}
|
544
617
|
.bar {.foo;}
|
@@ -546,10 +619,12 @@ LESS
|
|
546
619
|
|
547
620
|
assert_renders <<SCSS, <<LESS
|
548
621
|
@mixin foo($a: 2px + 3px, $b: red) {
|
549
|
-
a: $a;
|
622
|
+
a: $a;
|
623
|
+
}
|
550
624
|
|
551
625
|
.bar {
|
552
|
-
@include foo(5px);
|
626
|
+
@include foo(5px);
|
627
|
+
}
|
553
628
|
SCSS
|
554
629
|
.foo(@a: 2px + 3px, @b: #f00) {a: @a}
|
555
630
|
.bar {.foo(5px);}
|
@@ -564,11 +639,13 @@ WARNING: Sass doesn't support mixing in selector sequences.
|
|
564
639
|
Replacing ".foo .bar" with "@extend .bar"
|
565
640
|
WARN
|
566
641
|
.foo .bar {
|
567
|
-
a: b;
|
642
|
+
a: b;
|
643
|
+
}
|
568
644
|
|
569
645
|
.bar {
|
570
646
|
// .foo .bar;
|
571
|
-
@extend .bar;
|
647
|
+
@extend .bar;
|
648
|
+
}
|
572
649
|
SCSS
|
573
650
|
.foo .bar {a: b}
|
574
651
|
.bar {.foo .bar;}
|
@@ -581,11 +658,13 @@ WARNING: Sass doesn't support mixing in selector sequences.
|
|
581
658
|
Replacing "> .bar" with "@extend .bar"
|
582
659
|
WARN
|
583
660
|
.foo > .bar {
|
584
|
-
a: b;
|
661
|
+
a: b;
|
662
|
+
}
|
585
663
|
|
586
664
|
.bar {
|
587
665
|
// > .bar;
|
588
|
-
@extend .bar;
|
666
|
+
@extend .bar;
|
667
|
+
}
|
589
668
|
SCSS
|
590
669
|
.foo > .bar {a: b}
|
591
670
|
.bar {> .bar;}
|
@@ -600,10 +679,12 @@ WARNING: Sass doesn't support attribute accessors.
|
|
600
679
|
Ignoring .magic-box['content']
|
601
680
|
WARN
|
602
681
|
.magic-box {
|
603
|
-
content: "gold";
|
682
|
+
content: "gold";
|
683
|
+
}
|
604
684
|
|
605
685
|
.foo {
|
606
|
-
content: /* .magic-box['content'] */;
|
686
|
+
content: /* .magic-box['content'] */;
|
687
|
+
}
|
607
688
|
SCSS
|
608
689
|
.magic-box {content: "gold"}
|
609
690
|
.foo {content: .magic-box['content']}
|
@@ -617,10 +698,12 @@ Ignoring .magic-box[@content]
|
|
617
698
|
WARN
|
618
699
|
.magic-box {
|
619
700
|
$content: "gold";
|
620
|
-
content: $content;
|
701
|
+
content: $content;
|
702
|
+
}
|
621
703
|
|
622
704
|
.foo {
|
623
|
-
content: /* .magic-box[@content] */;
|
705
|
+
content: /* .magic-box[@content] */;
|
706
|
+
}
|
624
707
|
SCSS
|
625
708
|
.magic-box {@content: "gold"; content: @content}
|
626
709
|
.foo {content: .magic-box[@content]}
|