A platform for community discussion. Free, open, simple.
@use "lib/viewport";
.manageable-row-list {
.d-modal__body {
padding-inline: 0;
padding-block: var(--space-3);
}
&__search-wrapper {
padding: var(--space-2) 1.5rem;
border-bottom: 1px solid var(--primary-low);
background: var(--secondary);
}
&__counter {
color: var(--primary-medium);
font-size: var(--font-down-2-rem);
}
&__list {
display: flex;
flex-direction: column;
@include unstyled-list;
}
&__row {
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-3) var(--space-6);
background: var(--secondary);
box-shadow:
inset 0 2px 0 0 transparent,
inset 0 -2px 0 0 transparent;
.manageable-row-list__list.--dragging & {
transition: box-shadow 0.1s ease;
}
&:not(:last-child) {
border-bottom: 1px solid var(--primary-low);
}
&[draggable="true"] {
cursor: grab;
}
&.dragging {
opacity: 0.5;
}
&.drag-below,
&:not(.dragging):has(+ .manageable-row-list__row.drag-above) {
box-shadow:
inset 0 2px 0 0 transparent,
inset 0 -2px 0 0 var(--tertiary);
}
&:first-child.drag-above,
.manageable-row-list__row.dragging + &.drag-above {
box-shadow:
inset 0 2px 0 0 var(--tertiary),
inset 0 -2px 0 0 transparent;
}
@include viewport.until(sm) {
padding: var(--space-2) var(--space-3) var(--space-2) var(--space-6);
}
}
&__grip {
align-self: flex-start;
color: var(--primary-low-mid);
visibility: hidden;
.manageable-row-list__list.--reorderable
.manageable-row-list__row.--enabled
& {
visibility: visible;
}
}
&__order-mobile {
display: flex;
flex-direction: column;
gap: var(--space-2);
visibility: hidden;
.manageable-row-list__list.--reorderable
.manageable-row-list__row.--enabled
& {
visibility: visible;
}
}
&__row-text {
display: flex;
flex-direction: column;
gap: var(--space-half);
flex: 1 1 auto;
min-width: 0;
}
&__row-heading {
display: flex;
align-items: center;
gap: var(--space-2);
min-width: 0;
}
&__title {
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
min-width: 0;
}
&__description {
margin: 0;
color: var(--primary-medium);
font-size: var(--font-down-1);
}
&__arrow {
flex: 0 0 auto;
}
.d-modal__footer {
justify-content: flex-end;
@include viewport.until(sm) {
flex-direction: column;
align-items: flex-end;
gap: var(--space-2);
}
}
&__footer-note {
margin: 0;
margin-right: auto;
color: var(--primary-medium);
font-size: var(--font-down-1);
}
}
/* The reordering surface behind `enable_new_reordering_controls`.
TODO (ui-kit-reorderable-list-cleanup) fold back above once the change
ships. */
.manageable-row-list {
&__row-content {
display: flex;
flex: 1 1 auto;
align-items: center;
gap: var(--space-3);
min-width: 0;
}
/* The grip carries its own cursor; promising the whole row drags would
misdescribe a press on the label, which selects. */
&__row.d-reorderable-list__row[draggable="true"] {
cursor: auto;
}
/* A row that cannot move renders no grip at all, so its text would start at
the row's own edge while a movable neighbour's starts past the grip, and
the column reads ragged. Reserve the grip's footprint instead: 24px is the
size the shared list gives it, plus the row's own gap. */
&__row.d-reorderable-list__row:not(:has(.d-reorderable-list__handle)) {
padding-inline-start: calc(var(--space-6) + 24px + var(--space-3));
}
}