12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- @use 'sass:map';
- @use 'sass:math';
- $select-size: $text-input-height;
- $chevron-width: 1rem;
- $chevron-height: 1rem;
- $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: url('#{$images-root}icons/arrow-down.svg');
- background-repeat: no-repeat;
- background-size: $chevron-width;
- background-position-x: calc(100% - $chevron-inline-end-offset);
- background-position-y: $chevron-top-offset;
- }
- 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 field’s 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');
- }
- }
|