|
1 | 1 | @use "../../themes/ionic/ionic.globals.scss" as globals; |
2 | 2 | @use "./select.common"; |
| 3 | +@use "./select.ionic.outline" as outline; |
3 | 4 |
|
4 | 5 | // Ionic Select |
5 | 6 | // ------------------------------------------------- |
6 | 7 |
|
| 8 | +:host { |
| 9 | + --background: #{globals.$ion-primitives-base-white}; |
| 10 | + --padding-start: #{globals.$ion-space-400}; |
| 11 | + --padding-end: #{globals.$ion-space-400}; |
| 12 | + --padding-top: #{globals.$ion-space-300}; |
| 13 | + --padding-bottom: #{globals.$ion-space-300}; |
| 14 | + --placeholder-color: #{globals.$ion-primitives-neutral-800}; |
| 15 | + |
| 16 | + width: fit-content; |
| 17 | +} |
| 18 | + |
7 | 19 | // Select Label |
8 | 20 | // ---------------------------------------------------------------- |
9 | 21 |
|
10 | 22 | .label-text-wrapper { |
11 | 23 | @include globals.typography(globals.$ion-body-sm-medium); |
| 24 | + |
| 25 | + color: globals.$ion-primitives-neutral-1000; |
| 26 | +} |
| 27 | + |
| 28 | +// Select Label Placement - Start & Fixed |
| 29 | +// ---------------------------------------------------------------- |
| 30 | + |
| 31 | +:host(.select-label-placement-start) .label-text-wrapper, |
| 32 | +:host(.select-label-placement-fixed) .label-text-wrapper { |
| 33 | + /** |
| 34 | + * The margin between the label and |
| 35 | + * the select should be on the end |
| 36 | + * when the label sits at the start. |
| 37 | + */ |
| 38 | + @include globals.margin(0, globals.$ion-space-100, 0, 0); |
| 39 | +} |
| 40 | + |
| 41 | +// Select Label Placement - End |
| 42 | +// ---------------------------------------------------------------- |
| 43 | + |
| 44 | +:host(.select-label-placement-end) .label-text-wrapper { |
| 45 | + /** |
| 46 | + * The margin between the label and |
| 47 | + * the select should be on the start |
| 48 | + * when the label sits at the end. |
| 49 | + */ |
| 50 | + @include globals.margin(0, 0, 0, globals.$ion-space-100); |
| 51 | +} |
| 52 | + |
| 53 | +// Select Label Placement - Stacked & Floating |
| 54 | +// ---------------------------------------------------------------- |
| 55 | + |
| 56 | +:host(.select-label-placement-stacked) .label-text-wrapper, |
| 57 | +:host(.select-label-placement-floating) .label-text-wrapper { |
| 58 | + /** |
| 59 | + * The margin between the label and |
| 60 | + * the select should be on the bottom |
| 61 | + * when the label sits at the top. |
| 62 | + */ |
| 63 | + @include globals.margin(0, 0, globals.$ion-space-100, 0); |
| 64 | +} |
| 65 | + |
| 66 | +// Select Text |
| 67 | +// ---------------------------------------------------------------- |
| 68 | + |
| 69 | +// Targets the text inside the select and the placeholder |
| 70 | +.select-text { |
| 71 | + @include globals.typography(globals.$ion-body-md-regular); |
| 72 | + |
| 73 | + color: globals.$ion-primitives-neutral-1200; |
| 74 | +} |
| 75 | + |
| 76 | +// Select Wrapper |
| 77 | +// ---------------------------------------------------------------- |
| 78 | + |
| 79 | +.select-wrapper { |
| 80 | + background: transparent; |
| 81 | +} |
| 82 | + |
| 83 | +// Select Inner Wrapper |
| 84 | +// ---------------------------------------------------------------- |
| 85 | + |
| 86 | +.select-wrapper-inner { |
| 87 | + position: relative; |
| 88 | + |
| 89 | + min-width: globals.$ion-scale-5000; |
| 90 | + height: globals.$ion-scale-1200; |
| 91 | + |
| 92 | + background: var(--background); |
| 93 | + |
| 94 | + box-sizing: border-box; |
| 95 | + |
| 96 | + gap: globals.$ion-space-200; |
| 97 | +} |
| 98 | + |
| 99 | +// Start/End Slots |
| 100 | +// ---------------------------------------------------------------- |
| 101 | + |
| 102 | +/** |
| 103 | + * Slotted buttons have a lot of default padding that can |
| 104 | + * cause them to look misaligned from other pieces such |
| 105 | + * as the control's label, especially when using a clear |
| 106 | + * fill. We also make them circular to ensure that non- |
| 107 | + * clear buttons and the focus/hover state on clear ones |
| 108 | + * don't look too crowded. |
| 109 | + */ |
| 110 | +::slotted(ion-button[slot="start"].button-has-icon-only), |
| 111 | +::slotted(ion-button[slot="end"].button-has-icon-only) { |
| 112 | + --border-radius: 50%; |
| 113 | + --padding-start: 8px; |
| 114 | + --padding-end: 8px; |
| 115 | + --padding-top: 8px; |
| 116 | + --padding-bottom: 8px; |
| 117 | + |
| 118 | + aspect-ratio: 1; |
| 119 | +} |
| 120 | + |
| 121 | +// Select Icon |
| 122 | +// -------------------------------------------------- |
| 123 | + |
| 124 | +.select-icon, |
| 125 | +::slotted(ion-icon) { |
| 126 | + width: globals.$ion-scale-400; |
| 127 | + height: globals.$ion-scale-400; |
| 128 | +} |
| 129 | + |
| 130 | +.select-icon { |
| 131 | + color: globals.$ion-primitives-neutral-800; |
12 | 132 | } |
0 commit comments