File size: 3,040 Bytes
1e92f2d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | .form-select {
background:
var(--color-surface)
url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOSAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE1LjUgNi43NTAwMUw5LjUgMTIuNzVMMy41IDYuNzUwMDFMNC41NjA1IDUuNjg5NTFMOS41IDEwLjYyOUwxNC40Mzk1IDUuNjg5NTFMMTUuNSA2Ljc1MDAxWiIgZmlsbD0iIzY0Njk3MCIvPgo8L3N2Zz4K)
no-repeat right 10px center;
border-color: var(--color-neutral-10);
border-style: solid;
border-radius: 2px;
border-width: 1px;
color: var(--color-neutral-70);
cursor: pointer;
display: inline-block;
margin: 0 0 1em;
outline: 0;
overflow: hidden;
font-size: $font-body;
font-weight: 400;
/* stylelint-disable-next-line declaration-property-unit-allowed-list */
line-height: 1.4em;
text-overflow: ellipsis;
text-decoration: none;
vertical-align: top;
white-space: nowrap;
box-sizing: border-box;
padding: 7px 32px 9px 14px; // Aligns the text to the 8px baseline grid and adds padding on right to allow for the arrow.
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
&:focus {
border-color: var(--color-primary);
box-shadow: 0 0 0 2px var(--color-primary-10);
outline: 0;
-moz-outline: none;
-moz-user-focus: ignore;
&.is-error {
box-shadow: 0 0 0 2px var(--color-error-10);
}
&.is-error:hover {
box-shadow: 0 0 0 2px var(--color-error-20);
}
}
&:disabled,
&:hover:disabled {
background:
url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE1IDYuNzUwMDFMOSAxMi43NUwzIDYuNzUwMDFMNC4wNjA1IDUuNjg5NTFMOSAxMC42MjlMMTMuOTM5NSA1LjY4OTUxTDE1IDYuNzUwMDFaIiBmaWxsPSIjQzNDNEM3Ii8+Cjwvc3ZnPgo=)
no-repeat right 10px center;
background-color: var(--studio-gray-0);
border-color: var(--gray-gray-10, #c3c4c7);
opacity: 1;
}
// A smaller variant that works well when presented inline with text
&.is-compact {
min-width: 0;
padding: 0 20px 2px 6px;
margin: 0 4px;
background-position: right 5px center;
background-size: 12px 12px;
}
// Make it display:block when it follows a label
label &,
label + & {
display: block;
min-width: 200px;
&.is-compact {
display: inline-block;
min-width: 0;
}
}
// IE: Remove the default arrow
&::-ms-expand {
display: none;
}
// IE: Remove default background and color styles on focus
&::-ms-value {
background: none;
color: var(--color-neutral-70);
}
// Firefox: Remove the focus outline, see http://stackoverflow.com/questions/3773430/remove-outline-from-select-box-in-ff/18853002#18853002
&:-moz-focusring {
color: transparent;
text-shadow: 0 0 0 var(--color-neutral-70);
}
&.is-error {
border-color: var(--color-error);
}
&.is-error:hover {
border-color: var(--color-error-dark);
}
&:disabled {
color: var(--studio-gray-20);
}
}
// According to CSS tricks, browser support is IE9+
.form-select:only-of-type,
.form-select:last-of-type {
margin-bottom: 0;
}
|