2019-01-02 00:11:47 +01:00
|
|
|
.chooser {
|
2022-08-02 10:29:08 +02:00
|
|
|
&.blank .chosen {
|
|
|
|
display: none;
|
2022-02-04 12:57:55 +01:00
|
|
|
}
|
2019-01-02 00:11:47 +01:00
|
|
|
|
2022-08-02 10:29:08 +02:00
|
|
|
&:not(.blank) .unchosen {
|
2019-01-02 00:11:47 +01:00
|
|
|
display: none;
|
|
|
|
}
|
2022-08-02 10:29:08 +02:00
|
|
|
}
|
2019-01-02 00:11:47 +01:00
|
|
|
|
2022-08-02 10:29:08 +02:00
|
|
|
// Very subdued button style specifically for choosers, as there can be a lot of
|
|
|
|
// chooser fields left unused on a page editing form.
|
|
|
|
.chooser__choose-button {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
border-color: transparent;
|
|
|
|
padding-inline-start: 0;
|
|
|
|
// So the outline is slightly more separated from the text.
|
|
|
|
padding-inline-end: $focus-outline-width;
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
@include svg-icon(theme('spacing.5'), initial);
|
|
|
|
color: inherit;
|
|
|
|
margin-inline-end: 5px;
|
2022-02-04 12:57:55 +01:00
|
|
|
}
|
2019-01-02 00:11:47 +01:00
|
|
|
|
2022-08-02 10:29:08 +02:00
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
color: $color-button-hover;
|
|
|
|
background-color: $color-white;
|
2022-02-04 12:57:55 +01:00
|
|
|
}
|
2019-01-02 00:11:47 +01:00
|
|
|
}
|
|
|
|
|
2022-08-02 10:29:08 +02:00
|
|
|
.chosen {
|
|
|
|
display: flex;
|
|
|
|
gap: theme('spacing.4');
|
|
|
|
align-items: center;
|
|
|
|
}
|
2022-02-04 12:57:55 +01:00
|
|
|
|
2022-08-02 10:29:08 +02:00
|
|
|
.chooser__preview {
|
|
|
|
display: grid;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
width: 60px;
|
|
|
|
height: 60px;
|
|
|
|
// Prevent this item from getting smaller if the title is long.
|
|
|
|
flex-shrink: 0;
|
|
|
|
background-color: theme('colors.grey.150');
|
|
|
|
color: $color-white;
|
|
|
|
border-radius: theme('borderRadius.sm');
|
|
|
|
|
|
|
|
@media (forced-colors: active) {
|
|
|
|
border: 1px solid transparent;
|
2022-02-04 12:57:55 +01:00
|
|
|
}
|
2019-01-02 00:11:47 +01:00
|
|
|
|
2022-08-02 10:29:08 +02:00
|
|
|
.icon {
|
|
|
|
width: theme('spacing.7');
|
|
|
|
height: theme('spacing.7');
|
|
|
|
color: inherit;
|
2022-02-04 12:57:55 +01:00
|
|
|
}
|
2019-01-02 00:11:47 +01:00
|
|
|
}
|
|
|
|
|
2022-08-02 10:29:08 +02:00
|
|
|
.chooser__title {
|
|
|
|
@apply w-body-text-large;
|
|
|
|
}
|
2022-02-04 12:57:55 +01:00
|
|
|
|
2022-08-02 10:29:08 +02:00
|
|
|
.chooser__actions {
|
|
|
|
display: flex;
|
|
|
|
gap: theme('spacing.[1.5]');
|
|
|
|
|
|
|
|
.button {
|
|
|
|
// Subdued border as there can be a lot of chooser action buttons on a page.
|
|
|
|
border-color: theme('colors.grey.150');
|
|
|
|
}
|
2022-02-04 12:57:55 +01:00
|
|
|
|
2022-08-03 17:05:31 +02:00
|
|
|
// Hiding for devices capable of hover states only,
|
|
|
|
// with opacity only so keyboard focus can move to the first interactive element to reveal it.
|
2022-08-02 10:29:08 +02:00
|
|
|
@media (hover: hover) {
|
2022-08-03 17:05:31 +02:00
|
|
|
opacity: 0;
|
2022-02-04 12:57:55 +01:00
|
|
|
|
2022-08-03 17:05:31 +02:00
|
|
|
.chooser:hover &,
|
|
|
|
.chooser:focus-within & {
|
|
|
|
opacity: 1;
|
2019-01-02 00:11:47 +01:00
|
|
|
}
|
2022-02-04 12:57:55 +01:00
|
|
|
}
|
2019-01-02 00:11:47 +01:00
|
|
|
}
|
2022-08-02 10:29:08 +02:00
|
|
|
|
|
|
|
.chooser__image {
|
|
|
|
max-width: 200px;
|
|
|
|
max-height: 140px;
|
|
|
|
height: auto;
|
|
|
|
width: auto;
|
|
|
|
}
|