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

@@ -38,7 +38,7 @@
}
.informational-overlays .overlay-tabs .tab-switcher {
margin-left: 15px ;
margin-left: 15px;
}
.informational-overlays .overlay-tabs .exit {

View File

@@ -799,8 +799,8 @@ just a temporary hack.
}
@keyframes rotate {
from { transform:rotate(0deg); }
to { transform:rotate(359deg); }
from { transform: rotate(0deg); }
to { transform: rotate(359deg); }
}
.messagebox-bottom {

View File

@@ -366,7 +366,13 @@ class CssDeclaration(object):
res += self.pre_fluff
res += self.css_property
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 += self.post_fluff
return res

View File

@@ -63,7 +63,7 @@ class ParserTestHappyPath(unittest.TestCase):
'''
reformatted_css = '''
p { color: red ;}
p { color: red;}
'''
res = parse(my_css)