Adjust admin UI components based on desired interface density

pull/11869/head
Thibaud Colas 2024-04-18 10:28:17 +01:00
rodzic ddb907d274
commit d04746bf9e
5 zmienionych plików z 28 dodań i 13 usunięć

Wyświetl plik

@ -1,3 +1,5 @@
@use 'sass:math';
$preview-size: 2.625rem; // 42px
.chooser {
@ -61,8 +63,20 @@ $preview-size: 2.625rem; // 42px
}
.chooser__image {
max-width: 165px;
max-height: 125px;
$max-width: 165px;
$max-height: 125px;
// Adjust thumbnail size based on UI density, with safe minimums and maximums.
max-width: clamp(
math.div($max-width, 2),
calc($max-width * var(--w-density-factor)),
$max-width
);
max-height: clamp(
math.div($max-height, 2),
calc($max-height * var(--w-density-factor)),
$max-height
);
height: auto;
width: auto;
}

Wyświetl plik

@ -27,10 +27,10 @@ ul.listing {
td,
th {
padding: 1.2em 0.3em;
padding: calc(1em * var(--w-density-factor)) 0.3em;
@include media-breakpoint-up(sm) {
padding: 1.2em 1em;
padding: calc(1em * var(--w-density-factor)) 1em;
}
&.no-padding {
@ -48,16 +48,11 @@ ul.listing {
}
td {
vertical-align: top;
vertical-align: middle;
}
td.title {
line-height: 2em;
padding: 1em 0.3em;
@include media-breakpoint-up(sm) {
padding: 1em;
}
}
thead {
@ -248,7 +243,7 @@ ul.listing {
}
}
.icon.initial {
.icon-folder {
margin: 3px 0.3em 0 0;
vertical-align: top;
}

Wyświetl plik

@ -3,7 +3,9 @@ $header-button-size: theme('spacing.6');
.w-panel {
--header-gap: 0;
margin-bottom: theme('spacing.10');
margin-bottom: calc(
theme('spacing.5') + theme('spacing.5') * var(--w-density-factor)
);
@include media-breakpoint-up(sm) {
--header-gap: theme('spacing.4');

Wyświetl plik

@ -63,7 +63,7 @@
.w-field__input {
position: relative;
margin-top: theme('spacing.[2.5]');
margin-top: calc(theme('spacing.[2.5]') * var(--w-density-factor));
}
.w-field__icon {

Wyświetl plik

@ -35,6 +35,10 @@
padding-inline-start: theme('spacing[1.5]');
margin-inline-start: calc(-1 * theme('spacing[1.5]'));
.w-density-snug & {
font-size: theme('fontSize.26');
}
// Avoid calling attention to the field _unless_ its in one of those states.
&:not(:hover, :focus, :placeholder-shown, [aria-invalid='true']) {
// Hide w/ transparency to preserve border size and show it in forced-colors mode.