discourse/app/assets/stylesheets/common/base/sidebar-section.scss
Kris b1399d6a6f
DEV: move desktop sidebar-section CSS to common, remove desktop css index (#40803)
This moves our desktop sidebar-section.scss to the relevant common
stylesheet, and since it's the last remaining desktop stylesheet also
removes the desktop _index.scss, and removes the import from
desktop.scss 🎉
2026-06-11 15:09:09 -04:00

163 lines
3.3 KiB
SCSS
Vendored

@use "lib/viewport";
.sidebar-section-wrapper {
@include viewport.from(sm) {
padding-block: var(--space-1);
border-bottom: 1px solid var(--d-sidebar-section-border-color);
&:first-child {
padding-top: 0;
}
&[data-section-name="user-threads"] {
padding-bottom: 0;
}
}
.sidebar-section-header-wrapper {
display: flex;
border-radius: var(--d-border-radius);
@include viewport.from(sm) {
padding-right: var(--d-sidebar-row-horizontal-padding);
}
&:focus-within {
background: var(--d-sidebar-highlight-background);
}
.sidebar-section-header-button {
font-size: var(--font-down-1);
padding-inline: var(--space-1);
> * {
pointer-events: none;
}
}
.btn.dropdown-select-box-header,
.sidebar-section-header-button {
background: transparent;
padding-inline: var(--space-1);
padding-block: 0;
.discourse-no-touch & {
transition:
opacity 0.25s,
background 0.25s;
opacity: 0;
&:hover {
.d-icon {
color: var(--d-sidebar-highlight-color);
}
}
&:focus {
opacity: 1;
}
}
.d-icon {
font-size: var(--font-down-1);
color: var(--d-sidebar-header-icon-color);
margin: 0;
}
&:focus {
outline: 2px solid var(--token-color-background-accent-bolder);
}
}
}
&:hover {
.sidebar-section-header-wrapper {
.btn.dropdown-select-box-header,
.sidebar-section-header-button {
opacity: 1;
}
}
}
.sidebar-section-header {
flex: 1 1 auto;
align-items: center;
min-width: 0;
padding: 0;
font-size: var(--font-down-2-rem);
color: var(--d-sidebar-header-color);
font-weight: var(--d-sidebar-header-font-weight);
text-transform: uppercase;
letter-spacing: 0.05em;
gap: var(--d-sidebar-section-link-prefix-margin-right);
&.sidebar-section-header-collapsable {
justify-content: flex-start;
&:hover {
color: var(--d-sidebar-header-color);
.d-icon {
color: var(--d-sidebar-header-icon-color);
}
}
&:focus {
background: transparent;
}
}
}
.sidebar-section-header-text {
line-height: normal;
margin-right: var(--space);
@include ellipsis;
}
.sidebar-section-header-global-indicator {
margin: 0 var(--space-3) 0 var(--space-1);
font-size: var(--font-down-2);
.d-icon {
margin-top: calc(-1 * var(--space-half)); // optical alignment
}
}
.sidebar-section-header-caret {
display: flex;
flex: 0 0 auto;
width: var(--d-sidebar-section-link-prefix-width);
align-items: center;
justify-content: center;
.d-icon {
color: var(--d-sidebar-header-icon-color);
}
}
.select-kit-collection {
.texts {
font-size: var(--font-0);
text-transform: none;
line-height: var(--line-height-medium);
.name {
font-size: var(--font-0);
}
}
}
.sidebar-section-content {
margin: 0;
display: flex;
flex-direction: column;
gap: var(--d-sidebar-vertical-gap);
}
}
.sidebar-section-header-global-indicator__content {
.d-icon-shield-halved {
padding-right: var(--space-1);
}
}