UX: reduces white-space in polls (#6956)

* reduces white-space in polls and uses font-size variables
This commit is contained in:
Joe 2019-02-05 17:47:22 +08:00 committed by Régis Hanol
parent b6e3ef4a90
commit a342d2f150
3 changed files with 21 additions and 24 deletions

View File

@ -16,20 +16,17 @@ div.poll {
li { li {
cursor: pointer; cursor: pointer;
font-size: $font-up-1; font-size: $font-up-1;
&:not(:last-of-type) {
margin-bottom: 0.5em;
}
} }
li[data-poll-option-id] { li[data-poll-option-id] {
color: $primary; color: $primary;
padding: 0.5em 0.7em 0.7em 0.5em; padding: 0.5em 0;
} }
img { img {
max-width: 100% !important; /* needed to override internal styles */ // needed to override internal styles in image-sizing hack
max-width: 100% !important;
height: auto; height: auto;
margin-top: 0.25em;
} }
.poll-info { .poll-info {
@ -38,34 +35,34 @@ div.poll {
padding: 1em 0; padding: 1em 0;
.info-label { .info-label {
font-size: 1.7em; font-size: $font-up-4;
line-height: $line-height-medium; line-height: $line-height-medium;
} }
.info-text { .info-text {
margin: 5px 0; margin: 0.25em 0;
display: block; display: block;
} }
} }
.poll-container { .poll-container {
vertical-align: middle; vertical-align: middle;
padding: 0.8em; padding: 0.5em 1em;
.poll-results-number-rating { .poll-results-number-rating {
font-size: 2em; font-size: $font-up-5;
} }
} }
.poll-buttons { .poll-buttons {
.info-text { .info-text {
margin: 0 5px; margin: 0.25em 0;
color: $primary-medium; color: $primary-medium;
} }
} }
.poll-voters-list { .poll-voters:not(:empty) {
margin-top: 0.25em; margin-bottom: 0.25em;
li { li {
display: inline; display: inline;
} }
@ -79,17 +76,18 @@ div.poll {
.results { .results {
> li { > li {
cursor: default; cursor: default;
padding: 0.5em 0.7em 0.7em 0.5em; padding: 0.25em 0;
&:last-child {
padding-bottom: 0;
}
} }
.option { .option {
padding-bottom: 0.25em;
p { p {
margin: 0; margin: 0;
} }
} }
.percentage { .percentage {
font-size: $font-up-1;
float: right; float: right;
color: $primary-medium; color: $primary-medium;
margin-left: 0.25em; margin-left: 0.25em;

View File

@ -15,7 +15,7 @@ div.poll {
} }
p { p {
margin: 1.5em; margin: 0.5em 0;
} }
.info-label { .info-label {
@ -30,7 +30,7 @@ div.poll {
.poll-buttons { .poll-buttons {
border-top: 1px solid $primary-low; border-top: 1px solid $primary-low;
padding: 1em 1.25em; padding: 1em;
.info-text { .info-text {
line-height: 2em; line-height: 2em;

View File

@ -1,20 +1,19 @@
div.poll { div.poll {
.poll-buttons { .poll-buttons {
padding: 0.5em 1.25em 1em 1.25em; padding: 0.5em 1em 1em 1em;
button { button {
margin: 0.25em; margin-right: 0.5em;
} }
} }
.poll-info { .poll-info {
padding: 0.5em 1.25em 0 1.25em; padding: 0 1em;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
border-top: 1px solid $primary-low; border-top: 1px solid $primary-low;
.info-text { .info-text {
display: inline; display: inline;
margin: 0 0.5em 0.25em 0;
} }
.info-number { .info-number {
font-size: $font-up-6; font-size: $font-up-6;
@ -23,8 +22,8 @@ div.poll {
margin: 0; margin: 0;
width: 100%; width: 100%;
} }
.info-label:before { .info-label {
content: "\00a0"; //nbsp margin-left: 0.25em;
} }
} }
} }