UX: More compact polls on mobile

This commit is contained in:
Kris
2018-08-27 16:53:35 -04:00
parent 26e05933cd
commit d6144c6d60
3 changed files with 46 additions and 26 deletions

View File

@@ -1,5 +1,5 @@
div.poll { div.poll {
margin: 10px 0; margin: 1em 0;
border: 1px solid $primary-low; border: 1px solid $primary-low;
@include unselectable; @include unselectable;
@@ -15,8 +15,10 @@ div.poll {
li { li {
cursor: pointer; cursor: pointer;
font-size: 15px; font-size: $font-up-1;
margin-bottom: 10px; &:not(:last-of-type) {
margin-bottom: 0.5em;
}
} }
li[data-poll-option-id] { li[data-poll-option-id] {
@@ -27,19 +29,17 @@ div.poll {
img { img {
max-width: 100% !important; /* needed to override internal styles */ max-width: 100% !important; /* needed to override internal styles */
height: auto; height: auto;
margin-top: 0.25em;
} }
.poll-info { .poll-info {
color: $primary-medium; color: $primary-medium;
text-align: center;
vertical-align: middle; vertical-align: middle;
padding: 1em 0;
.info-number {
font-size: 3.5em;
}
.info-label { .info-label {
font-size: 1.7em; font-size: 1.7em;
line-height: $line-height-medium;
} }
.info-text { .info-text {
@@ -50,7 +50,7 @@ div.poll {
.poll-container { .poll-container {
vertical-align: middle; vertical-align: middle;
padding: 10px; padding: 0.8em;
.poll-results-number-rating { .poll-results-number-rating {
font-size: 2em; font-size: 2em;
@@ -68,11 +68,10 @@ div.poll {
} }
.poll-voters-list { .poll-voters-list {
margin-top: 0.25em;
li { li {
display: inline; display: inline;
} }
margin-top: 4px;
} }
.poll-voters-toggle-expand { .poll-voters-toggle-expand {
@@ -81,18 +80,21 @@ div.poll {
} }
.results { .results {
li {
padding: 0.5em 0.7em 0.7em 0.5em;
}
.option { .option {
padding-bottom: 5px; padding-bottom: 0.25em;
p { p {
margin: 0; margin: 0;
} }
} }
.percentage { .percentage {
font-size: 20px; font-size: $font-up-1;
float: right; float: right;
color: $primary-medium; color: $primary-medium;
margin-left: 5px; margin-left: 0.25em;
} }
.bar-back { .bar-back {
@@ -100,7 +102,7 @@ div.poll {
} }
.bar { .bar {
height: 10px; height: 0.75em;
background: $primary-medium; background: $primary-medium;
} }
@@ -112,8 +114,8 @@ div.poll {
&[data-poll-type="number"] { &[data-poll-type="number"] {
li[data-poll-option-id] { li[data-poll-option-id] {
display: inline-block; display: inline-block;
width: 45px; width: 3.25em;
margin-right: 5px; margin-right: 0.25em;
} }
} }
} }

View File

@@ -1,6 +1,5 @@
div.poll { div.poll {
display: table; display: table;
min-width: 500px;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
@@ -8,10 +7,15 @@ div.poll {
min-width: 150px; min-width: 150px;
width: 100%; width: 100%;
display: table-cell; display: table-cell;
text-align: center;
border-left: 1px solid $primary-low; border-left: 1px solid $primary-low;
.info-number {
font-size: 3.5em;
}
p { p {
margin: 40px 20px; margin: 1.5em;
} }
.info-label { .info-label {
@@ -21,13 +25,12 @@ div.poll {
.poll-container { .poll-container {
display: table-cell; display: table-cell;
min-width: 330px;
width: 100%; width: 100%;
} }
.poll-buttons { .poll-buttons {
border-top: 1px solid $primary-low; border-top: 1px solid $primary-low;
padding: 10px; padding: 1em 1.25em;
.toggle-status { .toggle-status {
float: right; float: right;
@@ -38,7 +41,7 @@ div.poll {
.d-editor-preview { .d-editor-preview {
.poll-buttons { .poll-buttons {
a:not(:first-child) { a:not(:first-child) {
margin-left: 5px; margin-left: 0.25em;
} }
} }
@@ -46,9 +49,9 @@ div.poll {
li[data-poll-option-id]:before { li[data-poll-option-id]:before {
font-family: FontAwesome; font-family: FontAwesome;
content: "\f10c"; content: "\f10c";
margin-right: 3px; margin-right: 0.25em;
position: relative; position: relative;
top: 1px; vertical-align: baseline;
} }
&[data-poll-type="multiple"] { &[data-poll-type="multiple"] {

View File

@@ -1,13 +1,28 @@
div.poll { div.poll {
.poll-buttons { .poll-buttons {
padding: 0 5px 5px 5px; padding: 0.5em 1.25em 1em 1.25em;
button { button {
margin: 4px 2px; margin: 0.25em;
} }
} }
.poll-info { .poll-info {
padding: 0.5em 1.25em 0 1.25em;
display: flex;
flex-wrap: wrap;
border-top: 1px solid $primary-low;
.info-text {
display: inline;
margin: 0 0.5em 0.25em 0;
}
.info-number {
font-size: $font-up-6;
}
p {
margin: 0;
width: 100%;
}
.info-label:before { .info-label:before {
content: "\00a0"; //nbsp content: "\00a0"; //nbsp
} }