aliddle-sass 1.0 → 1.01
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sass/exec.rb +4 -0
- data/lib/sass/tree/visitors/to_css.rb +7 -2
- metadata +3 -3
data/lib/sass/exec.rb
CHANGED
@@ -258,6 +258,10 @@ END
|
|
258
258
|
'Output style. Can be nested (default), compact, compressed, or expanded.') do |name|
|
259
259
|
@options[:for_engine][:style] = name.to_sym
|
260
260
|
end
|
261
|
+
opts.on('--singlespace', '--singlespace BOOL',
|
262
|
+
'Output can remove all blank lines, or leave them as SASS defaults.') do |linebreak|
|
263
|
+
@options[:for_engine][:singlespace] = linebreak
|
264
|
+
end
|
261
265
|
opts.on('--precision NUMBER_OF_DIGITS', Integer,
|
262
266
|
'How many digits of precision to use when outputting decimal numbers. Defaults to 3.') do |precision|
|
263
267
|
::Sass::Script::Number.precision = precision
|
@@ -189,16 +189,21 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
|
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
192
|
+
line_break = "\n"
|
193
|
+
if node.options[:singlespace] == 'true'
|
194
|
+
line_break = ''
|
195
|
+
end
|
196
|
+
|
192
197
|
if node.style == :compact
|
193
198
|
properties = with_tabs(0) {node.children.map {|a| visit(a)}.join(' ')}
|
194
|
-
to_return << "#{total_rule} { #{properties} }#{
|
199
|
+
to_return << "#{total_rule} { #{properties} }#{line_break if node.group_end}"
|
195
200
|
elsif node.style == :compressed
|
196
201
|
properties = with_tabs(0) {node.children.map {|a| visit(a)}.join(';')}
|
197
202
|
to_return << "#{total_rule}{#{properties}}"
|
198
203
|
else
|
199
204
|
properties = with_tabs(@tabs + 1) {node.children.map {|a| visit(a)}.join("\n")}
|
200
205
|
end_props = (node.style == :expanded ? "\n" + old_spaces : ' ')
|
201
|
-
to_return << "#{total_rule} {\n#{properties}#{end_props}}#{
|
206
|
+
to_return << "#{total_rule} {\n#{properties}#{end_props}}#{line_break if node.group_end}"
|
202
207
|
end
|
203
208
|
|
204
209
|
to_return
|
metadata
CHANGED
@@ -4,8 +4,8 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 1
|
7
|
-
-
|
8
|
-
version: "1.
|
7
|
+
- 1
|
8
|
+
version: "1.01"
|
9
9
|
platform: ruby
|
10
10
|
authors:
|
11
11
|
- Nathan Weizenbaum
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-09-
|
18
|
+
date: 2013-09-30 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|