2022-07-25 02:33:09 +00:00
|
|
|
|
@use 'sass:map';
|
|
|
|
|
@use 'sass:math';
|
|
|
|
|
|
|
|
|
|
$select-size: $text-input-height;
|
2023-04-19 05:58:14 +00:00
|
|
|
|
$chevron-width: 0.375rem;
|
|
|
|
|
$chevron-height: 0.375rem;
|
2022-07-25 02:33:09 +00:00
|
|
|
|
$chevron-top-offset: math.div($select-size - $chevron-height, 2);
|
|
|
|
|
$chevron-inline-end-offset: math.div($select-size - $chevron-width, 2);
|
|
|
|
|
|
|
|
|
|
@mixin select-arrow() {
|
2023-04-19 05:58:14 +00:00
|
|
|
|
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;
|
2022-07-25 02:33:09 +00:00
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
select {
|
|
|
|
|
@include input-base();
|
|
|
|
|
@include select-arrow();
|
|
|
|
|
@apply w-body-text-large;
|
2022-07-25 14:20:19 +00:00
|
|
|
|
// Firefox workaround – Set a large line height (but smaller than min height) so the field’s text has enough top padding.
|
|
|
|
|
line-height: 2.2;
|
|
|
|
|
min-height: $select-size;
|
2022-07-25 02:33:09 +00:00
|
|
|
|
padding: 0 theme('spacing.5');
|
2022-07-25 14:20:19 +00:00
|
|
|
|
padding-inline-end: $select-size;
|
2023-03-17 11:02:34 +00:00
|
|
|
|
// Prevent the element from overflowing the container.
|
|
|
|
|
max-width: 100%;
|
2022-07-25 14:20:19 +00:00
|
|
|
|
|
|
|
|
|
@media (forced-colors: active) {
|
|
|
|
|
appearance: auto;
|
|
|
|
|
}
|
2022-07-25 02:33:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
select[multiple] {
|
|
|
|
|
background-image: none;
|
|
|
|
|
min-height: theme('spacing.40');
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
|
|
|
|
option {
|
|
|
|
|
padding: 0 theme('spacing.5');
|
|
|
|
|
}
|
|
|
|
|
}
|