sass 3.4.17 → 3.4.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/lib/sass/tree/visitors/to_css.rb +26 -6
- data/test/sass/engine_test.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd8b86fbb1af2645a7d82f27de07d7f39e5f36de
|
4
|
+
data.tar.gz: 49afe949dd2d70186bd8b855a770d83ade01cf4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c97e8192675375f9adff2b79a79bdd322382689af2ab5f2192682e7c17eccffb173d9ef36cc0ca85fbd527a96f35c59d74e0ff2e4f2b31f90deeacc21951068
|
7
|
+
data.tar.gz: a37bb1312824bcf8c46543b31066b12aa0cd87c44d8970da5390eeb172d55a04df66d9db26d26c4156071c5afb393f6d117154f3107a6fc63f943557db93495a
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.4.
|
1
|
+
3.4.18
|
data/VERSION_DATE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
25 August 2015 20:10:56 UTC
|
@@ -51,6 +51,10 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
|
|
51
51
|
@source_mapping.add(source_range, target_range)
|
52
52
|
end
|
53
53
|
|
54
|
+
def ends_with?(str)
|
55
|
+
@result.end_with?(str)
|
56
|
+
end
|
57
|
+
|
54
58
|
# Move the output cursor back `chars` characters.
|
55
59
|
def erase!(chars)
|
56
60
|
return if chars == 0
|
@@ -124,6 +128,9 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
|
|
124
128
|
end
|
125
129
|
end
|
126
130
|
rstrip!
|
131
|
+
if node.style == :compressed && ends_with?(";")
|
132
|
+
erase! 1
|
133
|
+
end
|
127
134
|
return "" if @result.empty?
|
128
135
|
|
129
136
|
output "\n"
|
@@ -171,10 +178,10 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
|
|
171
178
|
if !node.has_children || node.children.empty?
|
172
179
|
output(tab_str)
|
173
180
|
for_node(node) {output(node.resolved_value)}
|
174
|
-
if node.
|
175
|
-
output("{
|
176
|
-
|
177
|
-
output(
|
181
|
+
if node.has_children
|
182
|
+
output("#{' ' unless node.style == :compressed}{}")
|
183
|
+
elsif node.children.empty?
|
184
|
+
output(";")
|
178
185
|
end
|
179
186
|
return
|
180
187
|
end
|
@@ -213,7 +220,9 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
|
|
213
220
|
had_children = child.has_children
|
214
221
|
first = false
|
215
222
|
elsif node.style == :compressed
|
216
|
-
|
223
|
+
unless had_children
|
224
|
+
output(";") unless ends_with?(";")
|
225
|
+
end
|
217
226
|
with_tabs(0) {visit(child)}
|
218
227
|
had_children = child.has_children
|
219
228
|
else
|
@@ -222,6 +231,9 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
|
|
222
231
|
end
|
223
232
|
end
|
224
233
|
rstrip!
|
234
|
+
if node.style == :compressed && ends_with?(";")
|
235
|
+
erase! 1
|
236
|
+
end
|
225
237
|
if node.style == :expanded
|
226
238
|
output("\n#{tab_str}")
|
227
239
|
elsif node.style != :compressed
|
@@ -342,10 +354,18 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
|
|
342
354
|
|
343
355
|
with_tabs(tabs) do
|
344
356
|
node.children.each_with_index do |child, i|
|
345
|
-
|
357
|
+
if i > 0
|
358
|
+
if separator.start_with?(";") && ends_with?(";")
|
359
|
+
erase! 1
|
360
|
+
end
|
361
|
+
output(separator)
|
362
|
+
end
|
346
363
|
visit(child)
|
347
364
|
end
|
348
365
|
end
|
366
|
+
if node.style == :compressed && ends_with?(";")
|
367
|
+
erase! 1
|
368
|
+
end
|
349
369
|
|
350
370
|
output(end_props)
|
351
371
|
output("}" + trailer)
|
data/test/sass/engine_test.rb
CHANGED
@@ -3313,6 +3313,16 @@ CSS
|
|
3313
3313
|
SASS
|
3314
3314
|
end
|
3315
3315
|
|
3316
|
+
def test_import_two_css_files_issue_1806
|
3317
|
+
assert_equal(<<CSS, render(<<SASS, :syntax => :scss, :style => :compressed))
|
3318
|
+
@import url(\"foo.css\");@import url(\"bar.css\");@import url(\"baz.css\")
|
3319
|
+
CSS
|
3320
|
+
@import url("foo.css");
|
3321
|
+
@import url("bar.css");
|
3322
|
+
@import url("baz.css");
|
3323
|
+
SASS
|
3324
|
+
end
|
3325
|
+
|
3316
3326
|
private
|
3317
3327
|
|
3318
3328
|
def assert_hash_has(hash, expected)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Natalie Weizenbaum
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-08-
|
13
|
+
date: 2015-08-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: yard
|