mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 20:08:26 +00:00
0d72a8c458
This plugin API can be used to add to sections and links to sidebar
389 lines
8.3 KiB
SCSS
389 lines
8.3 KiB
SCSS
:root {
|
|
--d-sidebar-width: 16em;
|
|
--d-sidebar-animation-time: 0.25s;
|
|
--d-sidebar-animation-ease: ease-in-out;
|
|
}
|
|
|
|
.header-sidebar-toggle {
|
|
--toggle-padding: 0.5em;
|
|
margin-right: 0.75em;
|
|
// extending the toggle beyond the page when space allows
|
|
// for better logo alignment with content
|
|
@media screen and (min-width: 1380px) {
|
|
margin-left: -3.5em;
|
|
}
|
|
|
|
// align on icon, because button is transparent
|
|
@media screen and (max-width: 1480px) {
|
|
margin-left: calc(var(--toggle-padding) * -1.3);
|
|
}
|
|
|
|
// prevents toggle overflow on smaller screens
|
|
@media screen and (max-width: 1379px) {
|
|
:not(.mobile-view) .has-sidebar-page & {
|
|
margin-left: initial;
|
|
}
|
|
}
|
|
|
|
transition: margin var(--d-sidebar-animation-speed)
|
|
var(--d-sidebar-animation-ease);
|
|
|
|
button {
|
|
position: relative;
|
|
font-size: var(--font-up-2);
|
|
padding: var(--toggle-padding);
|
|
|
|
.discourse-no-touch & {
|
|
&:hover {
|
|
background: var(--primary-low);
|
|
.d-icon {
|
|
color: var(--primary-medium);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#main-outlet-wrapper {
|
|
.sidebar-wrapper {
|
|
grid-area: sidebar;
|
|
position: sticky;
|
|
top: var(--header-offset);
|
|
height: calc(100vh - var(--header-offset));
|
|
align-self: start;
|
|
overflow-y: auto;
|
|
background-color: var(--primary-very-low);
|
|
.discourse-touch &,
|
|
&:hover {
|
|
.sidebar-section-header-caret {
|
|
opacity: 1;
|
|
transition-delay: 0s;
|
|
}
|
|
}
|
|
}
|
|
|
|
.sidebar-container {
|
|
box-sizing: border-box;
|
|
height: 100%;
|
|
width: var(--d-sidebar-width);
|
|
padding: 1em 0;
|
|
overflow-x: hidden;
|
|
overflow-y: auto;
|
|
|
|
// custom scrollbar styling
|
|
--scrollbarBg: transparent;
|
|
--scrollbarThumbBg: var(--primary-low);
|
|
--scrollbarWidth: 1.2em;
|
|
|
|
scrollbar-color: transparent var(--scrollbarBg);
|
|
transition: scrollbar-color 0.25s ease-in-out;
|
|
transition-delay: 0.5s;
|
|
|
|
&::-webkit-scrollbar-thumb {
|
|
background-color: transparent;
|
|
border-radius: calc(var(--scrollbarWidth) / 2);
|
|
border: calc(var(--scrollbarWidth) / 4) solid var(--primary-very-low);
|
|
}
|
|
&:hover {
|
|
scrollbar-color: var(--scrollbarThumbBg) var(--scrollbarBg);
|
|
&::-webkit-scrollbar-thumb {
|
|
background-color: var(--scrollbarThumbBg);
|
|
}
|
|
transition-delay: 0s;
|
|
}
|
|
&::-webkit-scrollbar {
|
|
width: var(--scrollbarWidth);
|
|
}
|
|
}
|
|
|
|
.sidebar-scroll-wrap {
|
|
// limit the wrapper width, so when the scrollbar is added the content doesn't shift
|
|
max-width: calc(var(--d-sidebar-width) - var(--scrollbarWidth));
|
|
}
|
|
|
|
.sidebar-toggle {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
}
|
|
|
|
.sidebar-section-wrapper {
|
|
margin-bottom: 1em;
|
|
}
|
|
|
|
.sidebar-section-header {
|
|
display: flex;
|
|
text-transform: uppercase;
|
|
font-size: 1em;
|
|
font-weight: bold;
|
|
align-items: stretch;
|
|
}
|
|
|
|
.sidebar-section-header-link,
|
|
.sidebar-section-header-text {
|
|
@include ellipsis;
|
|
flex: 1 1 auto;
|
|
color: var(--primary);
|
|
font-size: var(--font-down-1);
|
|
padding: 0.25em 0.5em;
|
|
}
|
|
|
|
.sidebar-section-header-link {
|
|
&:visited {
|
|
color: var(--primary);
|
|
}
|
|
|
|
&:hover {
|
|
background: var(--primary-low);
|
|
}
|
|
}
|
|
|
|
.select-kit {
|
|
.btn {
|
|
background: transparent;
|
|
&:hover {
|
|
background: var(--primary-low);
|
|
}
|
|
}
|
|
.d-icon {
|
|
font-size: var(--font-down-1);
|
|
color: var(--primary-medium);
|
|
margin-right: 0;
|
|
}
|
|
summary {
|
|
padding: 0.25em 0.5em;
|
|
}
|
|
}
|
|
|
|
.sidebar-section-header-button {
|
|
background: none;
|
|
border: none;
|
|
padding: 0.25em 0.5em;
|
|
|
|
.d-icon {
|
|
font-size: $font-down-1;
|
|
color: var(--primary-medium);
|
|
}
|
|
|
|
&:hover {
|
|
background: var(--primary-low);
|
|
}
|
|
}
|
|
.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-link-wrapper {
|
|
margin-left: 1.5em;
|
|
}
|
|
|
|
.sidebar-section-link {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 0.35em 0.5em;
|
|
color: var(--primary-high);
|
|
font-size: var(--font-down-1);
|
|
transition: background-color 0.25s;
|
|
|
|
&:hover {
|
|
background: var(--primary-low);
|
|
}
|
|
|
|
&.active {
|
|
color: var(--primary);
|
|
font-weight: bold;
|
|
}
|
|
|
|
.sidebar-section-link-content-badge {
|
|
width: 30%;
|
|
text-align: right;
|
|
}
|
|
|
|
.sidebar-section-link-content-text {
|
|
@include ellipsis;
|
|
|
|
.badge-wrapper {
|
|
font-size: 100%;
|
|
width: 100%;
|
|
|
|
.category-name {
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.sidebar-section-message-wrapper {
|
|
display: flex;
|
|
margin-left: 1.5em;
|
|
}
|
|
|
|
.sidebar-section-message {
|
|
padding: 0.25em 0.5em;
|
|
font-size: var(--font-down-1);
|
|
color: var(--primary-high);
|
|
}
|
|
|
|
.sidebar-section-link-content-badge {
|
|
color: var(--tertiary);
|
|
font-size: var(--font-down-1);
|
|
font-weight: normal;
|
|
margin-left: auto;
|
|
}
|
|
|
|
.sidebar-section-header-caret {
|
|
flex: 0 0 auto;
|
|
width: 1.5em;
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
align-items: center;
|
|
border: none;
|
|
background: transparent;
|
|
padding: 0;
|
|
opacity: 0;
|
|
transition: opacity 0.25s;
|
|
transition-delay: 0.5s;
|
|
.discourse-no-touch & {
|
|
&:hover {
|
|
svg {
|
|
color: var(--primary-high);
|
|
}
|
|
}
|
|
}
|
|
|
|
svg {
|
|
display: block;
|
|
flex: 0 0 auto;
|
|
transition: color 0.25s;
|
|
}
|
|
|
|
.d-icon {
|
|
font-size: $font-down-1;
|
|
color: var(--primary-medium);
|
|
}
|
|
}
|
|
|
|
.sidebar-section-content {
|
|
hr {
|
|
margin: 0em 1.5em;
|
|
}
|
|
}
|
|
|
|
.sidebar-section-link-personal-messages-sent,
|
|
.sidebar-section-link-personal-messages-new,
|
|
.sidebar-section-link-personal-messages-archive,
|
|
.sidebar-section-link-personal-messages-unread,
|
|
.sidebar-section-link-group-messages-new,
|
|
.sidebar-section-link-group-messages-unread,
|
|
.sidebar-section-link-group-messages-archive {
|
|
margin-left: 0.5em;
|
|
}
|
|
}
|
|
|
|
#main-outlet-wrapper .sidebar-section-wrapper {
|
|
.sidebar-section-link-prefix {
|
|
&.image {
|
|
img {
|
|
border-radius: 50%;
|
|
width: 20px;
|
|
aspect-ratio: auto 20 / 20;
|
|
height: 20px;
|
|
margin-right: 0.75em;
|
|
}
|
|
&.active img {
|
|
box-shadow: 0px 0px 0px 1px var(--success);
|
|
border: 1px solid var(--secondary);
|
|
}
|
|
}
|
|
&.text {
|
|
display: flex;
|
|
border-radius: 3px;
|
|
background: rgba(var(--primary-rgb), 0.1);
|
|
text-align: center;
|
|
font-weight: 700;
|
|
font-size: var(--font-down-1);
|
|
align-items: center;
|
|
padding: 0.25rem 0.5rem;
|
|
margin-right: 0.75em;
|
|
}
|
|
&.icon {
|
|
position: relative;
|
|
margin-right: 0.75em;
|
|
svg.prefix-badge {
|
|
position: absolute;
|
|
background-color: var(--secondary);
|
|
border-radius: 50%;
|
|
padding: 2px 2px 3px;
|
|
color: var(--primary-high);
|
|
height: 0.5rem;
|
|
width: 0.5rem;
|
|
margin-left: -0.4rem;
|
|
}
|
|
}
|
|
}
|
|
.sidebar-section-link-suffix.icon {
|
|
align-items: center;
|
|
display: flex;
|
|
margin-left: 0.5em;
|
|
svg {
|
|
width: 0.75em;
|
|
height: 0.75em;
|
|
}
|
|
&.urgent svg {
|
|
color: $success;
|
|
}
|
|
&.unread svg {
|
|
color: var(--tertiary-med-or-tertiary);
|
|
}
|
|
}
|
|
&.sidebar-section-chat-dms {
|
|
.sidebar-section-content {
|
|
.sidebar-section-link-wrapper {
|
|
display: inline-flex;
|
|
.sidebar-section-hover-button {
|
|
display: none;
|
|
color: var(--primary-medium);
|
|
align-self: center;
|
|
}
|
|
.sidebar-section-link-hover {
|
|
align-self: center;
|
|
}
|
|
}
|
|
.sidebar-section-link-wrapper:hover {
|
|
background: var(--primary-low);
|
|
transition: background-color 0.25s;
|
|
padding-right: 0.5em;
|
|
.sidebar-section-hover-button {
|
|
display: block;
|
|
}
|
|
}
|
|
a.sidebar-section-link {
|
|
width: calc(var(--d-sidebar-width) - 50px);
|
|
&:hover {
|
|
background: initial;
|
|
}
|
|
}
|
|
|
|
.sidebar-section-hover-button {
|
|
border: none;
|
|
background: transparent;
|
|
padding-left: 0.25em;
|
|
padding-right: 0.25em;
|
|
margin-left: 0.25em;
|
|
svg {
|
|
height: 0.75em;
|
|
width: 0.75em;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|