discourse/app/assets/stylesheets/common/base/sidebar.scss
Krzysztof Kotlarek 9f78ff5572
FEATURE: modal for admins to edit Community section (#21668)
Allow admins to edit Community section. This includes drag and drop reorder, change names, delete and reset to default.

Visual improvements introduced in edit community section modal are available in edit custom section form as well. For example:
- drag and drop links to change their position;
- smaller icon picker.
2023-05-29 15:20:23 +10:00

220 lines
4.6 KiB
SCSS

:root {
--d-sidebar-width: #{$d-sidebar-width};
@include breakpoint(large) {
--d-sidebar-width: #{$d-sidebar-narrow-width};
}
--d-sidebar-animation-time: 0.25s;
--d-sidebar-animation-ease: ease-in-out;
// 1.25rem gets text left-aligned with the hamburger icon
--d-sidebar-row-horizontal-padding: 1.25rem;
// ems so height is variable along with font size
--d-sidebar-row-height: 2.1em;
}
.sidebar-row {
box-sizing: border-box;
height: var(--d-sidebar-row-height);
padding: 0 var(--d-sidebar-row-horizontal-padding);
align-items: center;
}
.sidebar-wrapper {
display: flex;
--d-sidebar-highlight-color: var(--primary-low);
background-color: var(--primary-very-low);
grid-area: sidebar;
position: sticky;
top: var(--header-offset);
@include unselectable;
// 1dvh with fallback for old browsers
--1dvh: 1vh;
@supports (height: 1dvh) {
--1dvh: 1dvh;
}
height: calc(
var(--composer-vh, var(--1dvh)) * 100 - var(--header-offset, 0px)
);
align-self: start;
overflow-y: auto;
.sidebar-container {
display: flex;
flex-direction: column;
box-sizing: border-box;
height: 100%;
width: 100%;
padding: 0;
overflow-x: hidden;
// allows sidebar to scroll to the bottom when the composer is open
height: calc(100% - var(--composer-height, 0px));
}
.sidebar-sections {
display: flex;
flex-direction: column;
box-sizing: border-box;
flex: 1;
padding: 1.35em 0 1em;
overflow-x: hidden;
overflow-y: overlay;
// custom scrollbar styling
--scrollbarBg: transparent;
--scrollbarThumbBg: var(--primary-low);
--scrollbarWidth: 0.5em;
scrollbar-color: transparent var(--scrollbarBg);
transition: scrollbar-color 0.25s ease-in-out;
transition-delay: 0.5s;
&::-webkit-scrollbar {
width: var(--scrollbarWidth);
}
&::-webkit-scrollbar-thumb {
background-color: transparent;
border-radius: calc(var(--scrollbarWidth) / 2);
}
&::-webkit-scrollbar-track {
background-color: transparent;
}
&:hover {
scrollbar-color: var(--scrollbarThumbBg) var(--scrollbarBg);
&::-webkit-scrollbar-thumb {
background-color: var(--scrollbarThumbBg);
}
transition-delay: 0s;
}
}
.sidebar-footer-wrapper {
.btn-flat.add-section {
padding: 0.25em 0.4em;
&:hover {
background: var(--d-sidebar-highlight-color);
svg {
color: var(--primary-medium);
}
}
}
}
}
.sidebar-section-form-modal {
.draggable {
cursor: move;
align-self: center;
margin-left: auto;
margin-right: auto;
-webkit-user-drag: element;
-khtml-user-drag: element;
-moz-user-drag: element;
-o-user-drag: element;
user-drag: element;
}
.dragging {
opacity: 0.4;
}
.modal-inner-container {
width: var(--modal-max-width);
}
form {
margin-bottom: 0;
}
.input-group input {
width: 100%;
}
input.warning {
border: 1px solid var(--danger);
}
.row-wrapper {
display: grid;
grid-template-columns: 25px 60px auto auto 2em;
gap: 1em;
padding: 0.5em 1px;
-webkit-user-drag: none;
-khtml-user-drag: none;
-moz-user-drag: none;
-o-user-drag: none;
user-drag: none;
cursor: default;
&.header {
padding-bottom: 0;
padding-top: 1em;
label {
margin-bottom: 0;
}
.link-url {
margin-left: -1em;
}
}
&.drag-above {
border-top: 1px dotted #666;
margin-top: -1px;
}
&.drag-below {
border-bottom: 1px dotted #666;
padding-bottom: calc(0.5em - 1px);
}
.link-icon {
grid-column: 1 / span 2;
padding-left: calc(25px + 1em);
}
&.mark-public-wrapper {
label {
grid-column: 1 / -1;
}
}
}
.delete-link {
height: 1em;
align-self: center;
margin-right: 1em;
}
.btn-flat.add-link,
.btn-flat.reset-link {
margin-top: 1em;
margin-left: -0.65em;
&:active,
&:focus {
background: none;
}
svg {
color: var(--tertiary);
width: 0.75em;
height: 0.75em;
}
&:hover svg {
color: var(--tertiary-hover);
}
}
.btn-flat.reset-link {
float: right;
}
.modal-footer {
display: flex;
justify-content: space-between;
.delete {
margin-right: 0;
}
}
.select-kit.multi-select .multi-select-header .formatted-selection {
display: none;
}
.modal-inner-container .select-kit {
width: 60px;
}
.select-kit.is-expanded .select-kit-body {
width: 220px !important;
}
}