|
19 | 19 | --placeholder-color: #{globals.$ion-primitives-neutral-800}; |
20 | 20 | --focus-ring-color: #{globals.$ion-border-focus-default}; |
21 | 21 | --focus-ring-width: #{globals.$ion-border-size-050}; |
| 22 | + --leading-icon-padding: #{calc(globals.$ion-scale-400 + globals.$ion-space-200)}; |
22 | 23 |
|
23 | 24 | @include globals.typography(globals.$ion-body-md-regular); |
24 | 25 | @include globals.padding(0); |
|
67 | 68 | font-size: globals.$ion-font-size-400; |
68 | 69 | } |
69 | 70 |
|
70 | | -// Searchbar Search & Clear Icon & Cancel Icon |
| 71 | +// Searchbar Search Icon & Clear Icon & Cancel Icon |
71 | 72 | // ----------------------------------------- |
72 | 73 |
|
73 | 74 | .searchbar-search-icon, |
|
80 | 81 | transform: translateY(-50%); |
81 | 82 | } |
82 | 83 |
|
83 | | -// Clear Icon & Cancel Icon |
| 84 | +// Searchbar Clear Icon & Cancel Icon |
84 | 85 | // ----------------------------------------- |
85 | 86 |
|
86 | 87 | .searchbar-clear-button:focus-visible, |
|
92 | 93 | opacity: 1; |
93 | 94 | } |
94 | 95 |
|
| 96 | +// Searchbar Search Icon & Cancel Icon |
| 97 | +// ----------------------------------------- |
| 98 | +:host(:not(.searchbar-has-leading-icons)) { |
| 99 | + --leading-icon-padding: #{globals.$ion-scale-0}; |
| 100 | +} |
| 101 | + |
95 | 102 | // Searchbar in Toolbar |
96 | 103 | // ----------------------------------------- |
97 | 104 |
|
|
113 | 120 | * the size of the leading icon (search or cancel), |
114 | 121 | * and the gap between the icon and the input. |
115 | 122 | */ |
116 | | - padding-inline-start: calc(9px + globals.$ion-scale-400 + globals.$ion-space-200); |
| 123 | + padding-inline-start: calc(9px + var(--leading-icon-padding)); |
117 | 124 | } |
118 | 125 |
|
119 | 126 | // Searchbar States |
|
181 | 188 | * the size of the trailing icon (clear), |
182 | 189 | * and the gap between the icon and the input. |
183 | 190 | */ |
184 | | - @include globals.padding-horizontal(calc(globals.$ion-space-300 + globals.$ion-scale-400 + globals.$ion-space-200)); |
| 191 | + @include globals.padding-horizontal(calc(globals.$ion-space-300 + var(--leading-icon-padding))); |
185 | 192 |
|
186 | 193 | height: globals.$ion-scale-1000; |
187 | 194 | } |
|
210 | 217 | * the size of the trailing icon (clear), |
211 | 218 | * and the gap between the icon and the input. |
212 | 219 | */ |
213 | | - @include globals.padding-horizontal(calc(globals.$ion-space-400 + globals.$ion-scale-400 + globals.$ion-space-200)); |
| 220 | + @include globals.padding-horizontal(calc(globals.$ion-space-400 + var(--leading-icon-padding))); |
214 | 221 |
|
215 | 222 | height: globals.$ion-scale-1200; |
216 | 223 | } |
|
229 | 236 | /* Large */ |
230 | 237 | :host(.searchbar-size-large) .searchbar-search-icon, |
231 | 238 | :host(.searchbar-size-large) .searchbar-cancel-button { |
| 239 | + --leading-icon-padding: #{calc(globals.$ion-scale-500 + globals.$ion-space-200)}; |
| 240 | + |
232 | 241 | width: globals.$ion-scale-500; |
233 | 242 | height: globals.$ion-scale-500; |
234 | 243 | } |
|
244 | 253 | * the size of the leading icon (search or cancel), |
245 | 254 | * and the gap between the icon and the input. |
246 | 255 | */ |
247 | | - padding-inline-start: calc(9px + globals.$ion-scale-500 + globals.$ion-space-200); |
| 256 | + padding-inline-start: calc(9px + var(--leading-icon-padding)); |
248 | 257 | } |
249 | 258 |
|
250 | 259 | :host(.searchbar-size-large) .searchbar-input { |
|
262 | 271 | * and the gap between the icon and the input. |
263 | 272 | */ |
264 | 273 | @include globals.padding-horizontal( |
265 | | - calc(globals.$ion-space-500 + globals.$ion-scale-500 + globals.$ion-space-200), |
| 274 | + calc(globals.$ion-space-500 + var(--leading-icon-padding)), |
266 | 275 | calc(globals.$ion-space-500 + globals.$ion-scale-400 + globals.$ion-space-200) |
267 | 276 | ); |
268 | 277 |
|
|
0 commit comments