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

@ -3,7 +3,7 @@
}
.table td {
padding-top: 2px;
padding-top: 2px;
padding-bottom: 2px;
white-space: nowrap;
}

View File

@ -229,19 +229,19 @@ table.compose_table {
/* Like .alert .close */
.send-status-close {
font-size: 17px;
font-size: 17px;
font-weight: bold;
color: black;
color: black;
text-shadow: 0 1px 0 white;
opacity: .2;
filter: alpha(opacity=20);
float: right;
opacity: .2;
filter: alpha(opacity=20);
float: right;
}
.send-status-close:hover {
cursor: pointer;
cursor: pointer;
opacity: .4;
filter: alpha(opacity=40);
filter: alpha(opacity=40);
}
#out-of-view-notification {
@ -274,12 +274,12 @@ table.compose_table {
position: absolute;
right: 5px;
top: 5px;
font-size: 17px;
font-size: 17px;
font-weight: bold;
color: black;
color: black;
text-shadow: 0 1px 0 white;
opacity: .2;
filter: alpha(opacity=20);
opacity: .2;
filter: alpha(opacity=20);
}
textarea.new_message_textarea {

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

@ -131,7 +131,7 @@
.column-middle,
.app-main .column-middle {
margin-left: 7px;
margin-left: 7px;
margin-right: 7px;
}
@ -140,7 +140,7 @@
}
.column-middle-inner {
margin-left: 0px;
margin-left: 0px;
margin-right: 15px;
}

View File

@ -236,7 +236,7 @@ input {
textarea,
label {
font-size: inherit;
font-size: inherit;
line-height: inherit;
}
@ -258,7 +258,7 @@ input[type="tel"],
input[type="color"]
{
font-size: inherit;
height: 1.4em;
height: 1.4em;
}
li,
@ -268,8 +268,8 @@ li,
}
.btn {
font-size: inherit;
height: auto;
font-size: inherit;
height: auto;
line-height: 100%;
}
@ -397,12 +397,12 @@ pre code {
/* Style inline code inside a link
to look more like a normal link */
a code {
color: #08C;
color: #08C;
border-color: #08C;
}
a:hover code {
color: #005580;
color: #005580;
border-color: #005580;
}
@ -597,13 +597,13 @@ td.pointer {
.message_header {
vertical-align: middle;
text-align: left;
text-align: left;
/* We can overflow-y if the font size gets big */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: 600;
line-height: 14px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: 600;
line-height: 14px;
position: relative;
z-index: 0;
}
@ -666,7 +666,7 @@ td.pointer {
top: 50%;
content: " ";
height: 0px;
width: 0px;
width: 0px;
position: absolute;
pointer-events: none;
margin-top: -14px;
@ -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 {
@ -1275,7 +1275,7 @@ blockquote {
blockquote p {
line-height: inherit;
font-size: inherit;
font-size: inherit;
}
.messagebox {
@ -1411,7 +1411,7 @@ blockquote p {
top: 50%;
content: " ";
height: 0px;
width: 0px;
width: 0px;
position: absolute;
pointer-events: none;
margin-top: -25px;
@ -1427,7 +1427,7 @@ blockquote p {
top: 50%;
content: " ";
height: 0px;
width: 0px;
width: 0px;
position: absolute;
pointer-events: none;
margin-top: -28px;
@ -1827,7 +1827,7 @@ div.floating_recipient {
/* If you change these, make sure to adjust the constants in
* loading.make_indicator as well */
margin-left: 20px;
font-size: 1.2em;
font-size: 1.2em;
font-weight: 300;
line-height: 38px;
}
@ -1912,7 +1912,7 @@ div.floating_recipient {
text-overflow: ellipsis;
text-align: center;
font-size: inherit;
font-size: inherit;
line-height: inherit;
}
@ -1925,7 +1925,7 @@ div.floating_recipient {
}
.popover hr {
margin-top: 5px;
margin-top: 5px;
margin-bottom: 5px;
}
@ -2215,7 +2215,7 @@ button.topic_edit_cancel {
}
.star:hover {
cursor: pointer;
cursor: pointer;
color: #0d7245;
}

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)