mirror of
https://github.com/discourse/discourse.git
synced 2026-08-07 13:19:19 +08:00
This fixes topic voting to make sure the UI shows by the topic title when the topic is loaded in nested mode. Also fixes a weird header-registeration bug so that on scroll the topic title goes in the header after nested replies is disabled for a topic.
186 lines
3.7 KiB
SCSS
Vendored
186 lines
3.7 KiB
SCSS
Vendored
@use "lib/viewport";
|
|
|
|
.voting-wrapper {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: stretch;
|
|
min-width: 2.5em;
|
|
margin-top: 0.1em; // minor vertical alignment tweak
|
|
|
|
.fk-d-tooltip__trigger-container,
|
|
.fk-d-tooltip__trigger,
|
|
.topic-voting-menu-trigger {
|
|
width: 100%;
|
|
}
|
|
|
|
.btn[disabled]:not(.is-loading) {
|
|
opacity: 1;
|
|
background: var(--primary-very-low);
|
|
border: 1px solid var(--content-border-color);
|
|
width: 100%;
|
|
|
|
span[aria-hidden="true"] {
|
|
display: none; // empty span added by tooltip component impacts height
|
|
}
|
|
|
|
.d-icon {
|
|
opacity: 0.5;
|
|
}
|
|
}
|
|
}
|
|
|
|
.voting-wrapper__button {
|
|
border-radius: var(--d-button-border-radius) var(--d-button-border-radius) 0 0;
|
|
padding: var(--space-1) var(--space-3);
|
|
background: var(--secondary);
|
|
border: 1px solid var(--content-border-color);
|
|
|
|
&:focus-visible,
|
|
.discourse-no-touch &:hover {
|
|
background: var(--primary-low);
|
|
|
|
.d-icon {
|
|
color: var(--primary-high);
|
|
}
|
|
}
|
|
|
|
&.btn-success {
|
|
.d-icon {
|
|
color: var(--success);
|
|
}
|
|
|
|
&:focus-visible,
|
|
.discourse-no-touch &:hover {
|
|
background: var(--primary-low);
|
|
|
|
.d-icon {
|
|
color: var(--success);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.voting-wrapper__count-text {
|
|
color: var(--primary-high);
|
|
}
|
|
|
|
.voting-wrapper__count {
|
|
border: 1px solid var(--content-border-color);
|
|
border-top: 0;
|
|
background: var(--secondary);
|
|
border-radius: 0 0 var(--d-button-border-radius) var(--d-button-border-radius);
|
|
font-size: var(--font-down-2);
|
|
padding: var(--space-half) var(--space-2);
|
|
text-align: center;
|
|
}
|
|
|
|
// grid layout for voting in topic title
|
|
#topic-title:has(.voting),
|
|
.nested-view__header:has(.voting) {
|
|
display: grid;
|
|
grid-template-columns: auto 1fr;
|
|
gap: 0 var(--topic-body-width-padding);
|
|
|
|
> * {
|
|
grid-column: 2;
|
|
}
|
|
|
|
.voting {
|
|
grid-column: 1;
|
|
grid-row: 1 / span 10; // can't use -1 with an implicit grid
|
|
align-self: start;
|
|
}
|
|
}
|
|
|
|
// topic title
|
|
.title-voting {
|
|
--topic-avatar-width: 48px;
|
|
width: var(--topic-avatar-width);
|
|
|
|
.voting-wrapper {
|
|
min-width: var(--topic-avatar-width);
|
|
}
|
|
|
|
.voting-wrapper__button {
|
|
padding-block: var(--space-2);
|
|
}
|
|
}
|
|
|
|
// docked header
|
|
.header-title-voting {
|
|
--secondary: var(--header_background);
|
|
--primary-high: var(--header_primary-high);
|
|
--primary-medium: var(--header_primary-high);
|
|
--primary-low: var(--header_primary-low);
|
|
--d-button-default-icon-color: var(--header_primary-high);
|
|
margin-top: 0.15em; // vertical alignment tweak
|
|
margin-right: var(--space-2);
|
|
|
|
@include viewport.until(sm) {
|
|
margin-top: -0.25em; // centering tweak
|
|
|
|
.voting-wrapper__count {
|
|
font-size: var(--font-down-3);
|
|
}
|
|
}
|
|
|
|
.voting-wrapper__button {
|
|
--primary-very-low: var(--header_background);
|
|
width: 100%;
|
|
padding: var(--space-1);
|
|
}
|
|
}
|
|
|
|
// voter popup
|
|
.voting-voters__list {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: var(--space-1);
|
|
padding: var(--space-2);
|
|
|
|
@include viewport.from(sm) {
|
|
max-width: 22.5em;
|
|
}
|
|
}
|
|
|
|
.voting-voters__avatar {
|
|
display: inline-flex;
|
|
}
|
|
|
|
.voting-voters__empty,
|
|
.voting-voters__loading {
|
|
padding: 0.5em;
|
|
color: var(--primary);
|
|
font-size: var(--font-down-1);
|
|
}
|
|
|
|
.voting-voters__overflow {
|
|
width: 100%;
|
|
padding: var(--space-2) var(--space-2) 0;
|
|
text-align: center;
|
|
color: var(--primary);
|
|
font-size: var(--font-down-1);
|
|
border-top: 1px solid var(--primary-low);
|
|
}
|
|
|
|
// hide like buttons on voting posts
|
|
.topic-post.voting-post {
|
|
button.like-count,
|
|
button.toggle-like {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
.topic-voting-menu__watch-toggle {
|
|
.d-icon-toggle-on {
|
|
color: var(--tertiary);
|
|
}
|
|
|
|
.discourse-no-touch & {
|
|
.btn:hover {
|
|
.d-icon-toggle-on {
|
|
color: var(--tertiary);
|
|
}
|
|
}
|
|
}
|
|
}
|