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 { .table td {
padding-top: 2px; padding-top: 2px;
padding-bottom: 2px; padding-bottom: 2px;
white-space: nowrap; white-space: nowrap;
} }

View File

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

View File

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

View File

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

View File

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

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

View File

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