discourse/plugins/poll/assets/stylesheets/common/poll.scss
Jarek Radosz cd4f251891
FEATURE: Poll breakdown 2.0 (#10345)
The poll breakdown modal replaces the grouped pie charts feature.

Includes:

* MODAL: Untangle `onSelectPanel`
Previously modal-tab component would call on click the onSelectPanel callback with itself (modal-tab) as `this` which severely limited its usefulness. Now showModal binds the callback to its controller.

"The PR includes a fix/change to d-modal (b7f6ec6) that hasn't been extracted to a separate PR because it's not currently possible to test a change like this in abstract, i.e. with dynamically created controllers/components in tests. The percentage/count toggle test for the poll breakdown feature is essentially a test for that d-modal modification."
2020-08-06 17:57:06 +02:00

190 lines
2.9 KiB
SCSS

div.poll {
margin: 1em 0;
border: 1px solid var(--primary-low);
@include unselectable;
ul,
ol {
margin: 0;
padding: 0;
list-style: none;
display: inline-block;
width: 100%;
}
li {
cursor: pointer;
font-size: $font-up-1;
}
li[data-poll-option-id] {
color: var(--primary);
padding: 0.5em 0;
word-break: break-word;
}
img {
// needed to override internal styles in image-sizing hack
max-width: 100% !important;
height: auto;
}
.poll-info {
color: var(--primary-medium);
vertical-align: middle;
padding: 1em 0;
.info-label {
font-size: $font-up-4;
line-height: $line-height-medium;
}
.info-text {
margin: 0.25em 0;
display: block;
}
}
.poll-container {
vertical-align: middle;
padding: 0.5em 1em;
.poll-results-number-rating {
font-size: $font-up-5;
}
}
.poll-buttons {
.info-text {
margin: 0.25em 0;
color: var(--primary-medium);
}
.info-text + .info-text,
button + .info-text {
margin-left: 0.5em;
}
}
.poll-voters:not(:empty) {
min-height: 30px;
margin-bottom: 0.25em;
li {
display: inline;
}
}
.poll-voters-toggle-expand {
width: 100%;
text-align: center;
.spinner {
margin-top: 0.25em;
}
}
.results {
> li {
cursor: default;
padding: 0.25em 0;
&:last-child {
padding-bottom: 0;
}
}
.option {
p {
margin: 0;
}
}
.percentage {
float: right;
color: var(--primary-medium);
margin-left: 0.25em;
}
.bar-back {
background: var(--primary-low);
}
.bar {
height: 0.75em;
background: var(--primary-medium);
}
.chosen .bar {
background: var(--tertiary);
}
}
&[data-poll-type="number"] {
li[data-poll-option-id] {
display: inline-block;
width: 3.25em;
margin-right: 0.25em;
}
}
.pie-chart-legends {
text-align: center;
margin: 10px 0;
.legend {
display: inline-block;
margin: 4px 0 4px 14px;
.swatch {
display: inline-block;
width: 24px;
height: 12px;
margin-right: 4px;
}
}
}
.poll-grouped-pies-controls {
display: flex;
justify-content: space-between;
}
.poll-results-chart {
height: 320px;
overflow-y: auto;
overflow-x: hidden;
}
.poll-show-breakdown {
margin-bottom: 10px;
}
}
div.poll.pie {
.poll-container {
display: inline-block;
height: 320px;
max-height: 320px;
overflow-y: auto;
}
.poll-info {
display: inline-block;
width: 150px;
}
}
// hides 0 vote count in crawler and print view
body.crawler {
.poll {
.poll-info,
.poll-button {
display: none;
}
}
}
.poll-ui-builder {
.poll-date input {
height: 30px;
}
}