tools/css: Trim whitespace around CSS values.

This commit is contained in:
Steve Howell 2017-03-14 08:36:22 -07:00 committed by showell
parent 2ffea94bd8
commit 1e5ec689b7
7 changed files with 45 additions and 39 deletions

View File

@ -366,7 +366,13 @@ class CssDeclaration(object):
res += self.pre_fluff res += self.pre_fluff
res += self.css_property res += self.css_property
res += ':' res += ':'
res += self.css_value.text() value_text = self.css_value.text()
if '\n' in value_text:
# gradient values can be multi-line
res += value_text.rstrip()
else:
res += ' '
res += value_text.strip()
res += ';' res += ';'
res += self.post_fluff res += self.post_fluff
return res return res