0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00
wagtail/client/scss/components/_chooser.scss

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

83 lines
1.7 KiB
SCSS
Raw Normal View History

2023-06-15 17:47:49 +02:00
$preview-size: 2.625rem; // 42px
.chooser {
2022-08-02 10:29:08 +02:00
&.blank .chosen {
display: none;
}
2022-08-02 10:29:08 +02:00
&:not(.blank) .unchosen {
display: none;
}
2022-08-02 10:29:08 +02: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.
2023-06-15 17:47:49 +02:00
.button.chooser__choose-button {
@apply w-label-3;
2022-08-02 10:29:08 +02:00
display: flex;
align-items: center;
2023-06-15 17:47:49 +02:00
color: theme('colors.text-button-outline-default');
2022-08-02 10:29:08 +02:00
border-color: transparent;
2023-06-15 17:47:49 +02:00
padding: theme('spacing.[1.5]');
2022-08-02 10:29:08 +02:00
.icon {
2023-06-15 17:47:49 +02:00
@include svg-icon(theme('spacing.4'), initial);
2022-08-02 10:29:08 +02:00
color: inherit;
margin-inline-end: 5px;
}
2022-08-02 10:29:08 +02:00
&:hover,
&:focus {
color: theme('colors.surface-button-hover');
background-color: theme('colors.surface-page');
}
}
2022-08-02 10:29:08 +02:00
.chosen {
display: flex;
gap: theme('spacing.4');
align-items: center;
}
2022-08-02 10:29:08 +02:00
.chooser__preview {
display: grid;
align-items: center;
justify-content: center;
2023-06-15 17:47:49 +02:00
width: $preview-size;
height: $preview-size;
2022-08-02 10:29:08 +02:00
// Prevent this item from getting smaller if the title is long.
flex-shrink: 0;
background-color: theme('colors.border-button-small-outline-default');
color: theme('colors.text-button');
2022-08-02 10:29:08 +02:00
border-radius: theme('borderRadius.sm');
@media (forced-colors: active) {
border: 1px solid transparent;
}
}
2022-08-02 10:29:08 +02:00
.chooser__title {
@apply w-body-text-large;
}
2022-08-02 10:29:08 +02:00
.chooser__image {
2023-06-15 17:47:49 +02:00
max-width: 165px;
max-height: 125px;
2022-08-02 10:29:08 +02:00
height: auto;
width: auto;
}
2023-06-15 17:47:49 +02:00
.chooser .w-dropdown__toggle--icon {
width: $preview-size;
height: $preview-size;
}
// Display these as inline block so that action icons such as comments can appear as close as possible
.w-field--admin_task_chooser,
.w-field--admin_page_chooser,
.w-field--document_chooser_widget,
.w-field--admin_image_chooser,
.w-field--admin_snippet_chooser {
display: inline-block;
}