discourse/app/assets/stylesheets/admin/users.scss
Kris d7de03d0b5
UX: refactor user delete button to dropdown (#39413)
This avoids a very long deletion button in a dialog by moving it to a
select-kit menu with description text instead. This avoids the long
button and allows the dialog that warns on delete to be more focused.

This also flips the confirmation order slightly, which I think is better
UX.

Previously we'd do:

> click delete -> confirm by choosing one of two types type of deletion 

Now it's 

> click delete -> select one of two types -> confirm  



Before: 
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/e62cba26-78ee-46eb-b432-6584de5d5fdf"
/>



<img width="350" alt="image"
src="https://github.com/user-attachments/assets/985cf650-22a4-4a34-b636-f45cc1f6cb6c"
/>

After: 
<img width="450" alt="image"
src="https://github.com/user-attachments/assets/d11ce3c9-d40b-4458-9954-795bda5a9e0a"
/>
<img width="425" alt="image"
src="https://github.com/user-attachments/assets/c8ee162e-48b2-4584-ae4a-36ca10addc29"
/>
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/ce5ceda9-bf03-4f12-a25f-99a42e939a60"
/>
2026-05-04 09:38:39 -04:00

259 lines
3.7 KiB
SCSS
Vendored

@use "lib/viewport";
// Styles for /admin/users
.display-row.associations .value {
width: 750px;
@media (max-width: $mobile-breakpoint) {
width: 75%;
float: right;
text-align: left;
margin-left: 0;
}
}
.display-row {
display: flex;
align-items: center;
padding: 10px 5px;
border-top: 1px solid var(--content-border-color);
&:nth-of-type(1) {
border-top: 0;
}
&.highlight-danger {
background-color: var(--danger-low);
}
&::before,
&::after {
display: table;
content: "";
}
&::after {
clear: both;
}
&.secondary-emails ul {
margin: 0;
list-style: none;
}
.field {
font-weight: bold;
width: 17.65765%;
min-width: 125px;
margin-left: 12px;
@media (max-width: $mobile-breakpoint) {
margin-left: 0;
line-height: var(--line-height-large);
margin-top: 5px;
}
}
.value {
width: 100%;
max-width: 350px;
min-width: 50px;
margin-left: 12px;
word-break: break-word;
@media (max-width: $mobile-breakpoint) {
text-align: left;
margin-left: 0;
}
.select-kit {
min-width: 100px;
width: inherit;
}
}
.long-value {
margin-left: 12px;
font-size: var(--font-down-1);
button {
margin-left: 10px;
}
}
.controls {
margin-left: 12px;
@media (max-width: $mobile-breakpoint) {
width: 75%;
text-align: left;
margin-left: 0;
}
.btn {
margin-right: 5px;
}
}
&.silence-info .controls {
display: flex;
margin-left: 0;
.full-reason {
margin-left: 0.3em;
}
}
&.username,
&.name {
.value {
word-break: break-all;
}
}
}
.admin-users {
input {
margin-bottom: 0;
}
.users-list {
.username .d-icon {
color: var(--primary-medium);
}
}
}
.admin-users-list {
.directory-table__cell {
padding: 0.5em 0.25em;
&.username {
align-items: center;
justify-content: start;
}
&.email {
justify-content: start;
@include viewport.until(md) {
grid-column-start: 1;
grid-column-end: -1;
span {
max-width: 100%;
}
}
span {
display: flex;
min-width: 17em;
word-break: break-all;
}
}
}
.directory-table {
margin-top: 1em;
&__column-header {
&--username,
&---email,
&--silence-reason {
.header-contents {
text-align: left;
}
}
&--username {
flex-grow: 1;
}
}
&__column-header-wrapper {
display: flex;
}
&__cell-bulk-select {
margin-right: 1em;
}
&__cell.silence_reason {
text-align: left;
justify-content: start;
span {
max-width: 12em;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
.user-status span {
gap: 0.15em;
}
.avatar {
margin-right: 0.25em;
}
&__controls {
display: flex;
gap: 1em;
}
}
// mobile styles
.mobile-view .admin-users.admin-user {
.display-row {
flex-direction: column;
align-items: flex-start;
.field,
.value {
width: 100%;
}
.select-kit {
width: 100%;
}
}
.long-value {
overflow-wrap: break-word;
max-width: 100%;
margin: 0;
button {
margin: 5px 0;
display: block;
}
}
h1 {
margin: 15px 0 5px 0;
}
.user-controls {
text-align: inherit;
}
.controls {
width: unset;
margin-top: 5px;
}
.associations button {
margin: 5px 5px 0 0;
}
}
.admin-user__danger-controls {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
width: 100%;
gap: var(--space-2);
}