0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00
wagtail/client/scss/components/forms/_select.scss
LB Johnston 35dfdea89c Update formatting - Prettier 3.0
- Run formatting with latest version of Prettier
2023-08-02 21:00:25 +10:00

60 lines
1.5 KiB
SCSS
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@use 'sass:map';
@use 'sass:math';
$select-size: $text-input-height;
$chevron-width: 0.375rem;
$chevron-height: 0.375rem;
$chevron-top-offset: math.div($select-size - $chevron-height, 2);
$chevron-inline-end-offset: math.div($select-size - $chevron-width, 2);
@mixin select-arrow() {
background-image: linear-gradient(
45deg,
transparent 50%,
theme('colors.text-label') 33%,
theme('colors.text-label') 66%,
transparent 66%
),
linear-gradient(
-45deg,
transparent 50%,
theme('colors.text-label') 33%,
theme('colors.text-label') 66%,
transparent 66%
);
background-position:
calc(100% - $chevron-top-offset - $chevron-width) $chevron-top-offset,
calc(100% - $chevron-inline-end-offset) $chevron-top-offset;
background-size:
$chevron-width $chevron-width,
$chevron-width $chevron-width;
background-repeat: no-repeat;
}
select {
@include input-base();
@include select-arrow();
@apply w-body-text-large;
// Firefox workaround Set a large line height (but smaller than min height) so the fields text has enough top padding.
line-height: 2.2;
min-height: $select-size;
padding: 0 theme('spacing.5');
padding-inline-end: $select-size;
// Prevent the element from overflowing the container.
max-width: 100%;
@media (forced-colors: active) {
appearance: auto;
}
}
select[multiple] {
background-image: none;
min-height: theme('spacing.40');
padding: 0;
option {
padding: 0 theme('spacing.5');
}
}