1
0
Fork 0
mirror of https://github.com/twbs/bootstrap-sass.git synced 2022-11-09 12:27:02 -05:00

converter: replace_calculation_semantics for any number of values

This commit is contained in:
Gleb Mazovetskiy 2013-08-21 16:24:46 +02:00
parent b261031050
commit 36426d1cc7

View file

@ -333,7 +333,7 @@ class Converter
replace_properties rule do |props|
props.gsub /(?<!\w)([\w-]+):(.*?);/ do |m|
prop, vals = $1, split_prop_val.call($2)
next m unless vals.length == 2 && vals.any? { |v| v =~ /^[\+\-]/ }
next m unless vals.length >= 2 && vals.any? { |v| v =~ /^[\+\-]\$/ }
transformed = vals.map { |v| v.strip =~ %r(^\(.*\)$) ? v : "(#{v})" }
log_transform "property #{prop}: #{transformed * ' '}"
"#{prop}: #{transformed * ' '};"