|
9 | 9 | * @prop --focus-ring-color: The color of the ring around the focused element. |
10 | 10 | * @prop --focus-ring-width: The width of the ring around the focused element. |
11 | 11 | */ |
12 | | - --background: #{globals.$ion-primitives-neutral-100}; |
| 12 | + --background: #{globals.$ion-bg-neutral-subtle-default}; |
13 | 13 | --border-radius: #{globals.$ion-border-radius-400}; |
14 | 14 | --box-shadow: none; |
15 | 15 | --cancel-button-color: #{globals.$ion-primitives-neutral-800}; |
16 | 16 | --clear-button-color: #{globals.$ion-primitives-neutral-1000}; |
17 | 17 | --color: #{globals.$ion-primitives-neutral-1200}; |
18 | | - --icon-color: #{globals.$ion-primitives-neutral-800}; |
19 | | - --placeholder-color: #{globals.$ion-primitives-neutral-800}; |
| 18 | + --icon-color: #{globals.$ion-icon-subtlest}; |
| 19 | + --placeholder-color: #{globals.$ion-text-subtlest}; |
20 | 20 | --focus-ring-color: #{globals.$ion-border-focus-default}; |
21 | 21 | --focus-ring-width: #{globals.$ion-border-size-050}; |
22 | 22 |
|
|
38 | 38 | .searchbar-input { |
39 | 39 | @include globals.padding(globals.$ion-space-300, null); |
40 | 40 |
|
| 41 | + text-overflow: ellipsis; |
| 42 | + |
41 | 43 | contain: strict; |
42 | 44 | } |
43 | 45 |
|
|
67 | 69 | font-size: globals.$ion-font-size-400; |
68 | 70 | } |
69 | 71 |
|
70 | | -// Searchbar Search & Clear Icon & Cancel Icon |
| 72 | +// Searchbar Search Icon & Clear Icon & Cancel Icon |
71 | 73 | // ----------------------------------------- |
72 | 74 |
|
73 | 75 | .searchbar-search-icon, |
|
80 | 82 | transform: translateY(-50%); |
81 | 83 | } |
82 | 84 |
|
83 | | -// Clear Icon & Cancel Icon |
| 85 | +// Searchbar Clear Icon & Cancel Icon |
84 | 86 | // ----------------------------------------- |
85 | 87 |
|
86 | 88 | .searchbar-clear-button:focus-visible, |
|
92 | 94 | opacity: 1; |
93 | 95 | } |
94 | 96 |
|
| 97 | +// Searchbar Search Icon & Cancel Icon |
| 98 | +// ----------------------------------------- |
| 99 | +:host(:not(.searchbar-has-leading-icons)) { |
| 100 | + $leading-icon-padding: #{globals.$ion-scale-0}; |
| 101 | +} |
| 102 | + |
| 103 | +:host(.searchbar-has-value) { |
| 104 | + --icon-color: #{globals.$ion-icon-default}; |
| 105 | +} |
| 106 | + |
95 | 107 | // Searchbar in Toolbar |
96 | 108 | // ----------------------------------------- |
97 | 109 |
|
98 | | -:host-context(ion-toolbar).searchbar-should-show-cancel .searchbar-cancel-button { |
| 110 | +:host(.in-toolbar.searchbar-should-show-cancel) .searchbar-cancel-button { |
99 | 111 | /** |
100 | 112 | * The left edge of the cancel button |
101 | 113 | * should align with the left edge |
|
106 | 118 | @include globals.position-horizontal(9px, null); |
107 | 119 | } |
108 | 120 |
|
109 | | -:host-context(ion-toolbar).searchbar-should-show-cancel .searchbar-input { |
110 | | - /** |
111 | | - * Padding start is based on |
112 | | - * the alignment of the back button, |
113 | | - * the size of the leading icon (search or cancel), |
114 | | - * and the gap between the icon and the input. |
115 | | - */ |
116 | | - padding-inline-start: calc(9px + globals.$ion-scale-400 + globals.$ion-space-200); |
117 | | -} |
118 | | - |
119 | 121 | // Searchbar States |
120 | 122 | // -------------------------------------------------- |
121 | 123 |
|
|
143 | 145 | /* Disabled */ |
144 | 146 | :host(.searchbar-disabled) { |
145 | 147 | --color: #{globals.$ion-primitives-neutral-500}; |
146 | | - --icon-color: #{globals.$ion-primitives-neutral-500}; |
147 | | - --placeholder-color: #{globals.$ion-primitives-neutral-500}; |
| 148 | + --icon-color: #{globals.$ion-icon-disabled}; |
| 149 | + --placeholder-color: #{globals.$ion-text-disabled}; |
148 | 150 |
|
149 | 151 | cursor: default; |
150 | 152 | pointer-events: none; |
|
170 | 172 |
|
171 | 173 | /* Small */ |
172 | 174 | :host(.searchbar-size-small) .searchbar-input { |
| 175 | + /** |
| 176 | + * Padding start is based on |
| 177 | + * desired padding from design, |
| 178 | + * no leading icons. |
| 179 | + * |
| 180 | + * Padding end is based on |
| 181 | + * desired padding from design, |
| 182 | + * no trailing icons. |
| 183 | + */ |
| 184 | + @include globals.padding-horizontal(globals.$ion-space-300); |
| 185 | + |
| 186 | + height: globals.$ion-scale-1000; |
| 187 | +} |
| 188 | + |
| 189 | +/* Small with Leading Icons */ |
| 190 | +:host(.searchbar-size-small.searchbar-should-show-search-icon) .searchbar-input, |
| 191 | +:host(.searchbar-size-small.searchbar-should-show-cancel) .searchbar-input { |
| 192 | + /** |
| 193 | + * Padding start is based on |
| 194 | + * desired padding from design, |
| 195 | + * the size of the leading icon (search or cancel), |
| 196 | + * and the gap between the icon and the input. |
| 197 | + * |
| 198 | + * Padding end is based on |
| 199 | + * desired padding from design, |
| 200 | + * no trailing icons. |
| 201 | + */ |
| 202 | + @include globals.padding-horizontal( |
| 203 | + calc(globals.$ion-space-300 + globals.$ion-scale-400 + globals.$ion-space-200), |
| 204 | + globals.$ion-space-300 |
| 205 | + ); |
| 206 | +} |
| 207 | + |
| 208 | +/* Small with Leading Icons and Trailing Icons */ |
| 209 | +:host(.searchbar-size-small.searchbar-should-show-search-icon.searchbar-should-show-clear) .searchbar-input, |
| 210 | +:host(.searchbar-size-small.searchbar-should-show-cancel.searchbar-should-show-clear) .searchbar-input { |
173 | 211 | /** |
174 | 212 | * Padding start is based on |
175 | 213 | * desired padding from design, |
|
182 | 220 | * and the gap between the icon and the input. |
183 | 221 | */ |
184 | 222 | @include globals.padding-horizontal(calc(globals.$ion-space-300 + globals.$ion-scale-400 + globals.$ion-space-200)); |
| 223 | +} |
185 | 224 |
|
186 | | - height: globals.$ion-scale-1000; |
| 225 | +/* Small with Trailing Icons */ |
| 226 | +:host(.searchbar-size-small.searchbar-should-show-clear) .searchbar-input { |
| 227 | + /** |
| 228 | + * Padding start is based on |
| 229 | + * desired padding from design, |
| 230 | + * no leading icons. |
| 231 | + * |
| 232 | + * Padding end is based on |
| 233 | + * desired padding from design, |
| 234 | + * the size of the trailing icon (clear), |
| 235 | + * and the gap between the icon and the input. |
| 236 | + */ |
| 237 | + @include globals.padding-horizontal( |
| 238 | + globals.$ion-space-300, |
| 239 | + calc(globals.$ion-space-300 + globals.$ion-scale-400 + globals.$ion-space-200) |
| 240 | + ); |
187 | 241 | } |
188 | 242 |
|
189 | 243 | :host(.searchbar-size-small) .searchbar-search-icon, |
|
199 | 253 |
|
200 | 254 | /* Medium */ |
201 | 255 | :host(.searchbar-size-medium) .searchbar-input { |
| 256 | + /** |
| 257 | + * Padding start is based on |
| 258 | + * desired padding from design, |
| 259 | + * no leading icons. |
| 260 | + * |
| 261 | + * Padding end is based on |
| 262 | + * desired padding from design, |
| 263 | + * no trailing icons. |
| 264 | + */ |
| 265 | + @include globals.padding-horizontal(globals.$ion-space-400); |
| 266 | + |
| 267 | + height: globals.$ion-scale-1200; |
| 268 | +} |
| 269 | + |
| 270 | +/* Medium with Leading Icons */ |
| 271 | +:host(.searchbar-size-medium.searchbar-should-show-search-icon) .searchbar-input, |
| 272 | +:host(.searchbar-size-medium.searchbar-should-show-cancel) .searchbar-input { |
| 273 | + /** |
| 274 | + * Padding start is based on |
| 275 | + * desired padding from design, |
| 276 | + * the size of the leading icon (search or cancel), |
| 277 | + * and the gap between the icon and the input. |
| 278 | + * |
| 279 | + * Padding end is based on |
| 280 | + * desired padding from design, |
| 281 | + * no trailing icons. |
| 282 | + */ |
| 283 | + @include globals.padding-horizontal( |
| 284 | + calc(globals.$ion-space-400 + globals.$ion-scale-400 + globals.$ion-space-200), |
| 285 | + globals.$ion-space-400 |
| 286 | + ); |
| 287 | +} |
| 288 | + |
| 289 | +/* Medium with Leading Icons and Trailing Icons */ |
| 290 | +:host(.searchbar-size-medium.searchbar-should-show-search-icon.searchbar-should-show-clear) .searchbar-input, |
| 291 | +:host(.searchbar-size-medium.searchbar-should-show-cancel.searchbar-should-show-clear) .searchbar-input { |
202 | 292 | /** |
203 | 293 | * Padding start is based on |
204 | 294 | * desired padding from design, |
|
211 | 301 | * and the gap between the icon and the input. |
212 | 302 | */ |
213 | 303 | @include globals.padding-horizontal(calc(globals.$ion-space-400 + globals.$ion-scale-400 + globals.$ion-space-200)); |
| 304 | +} |
214 | 305 |
|
215 | | - height: globals.$ion-scale-1200; |
| 306 | +/* Medium with Trailing Icons */ |
| 307 | +:host(.searchbar-size-medium.searchbar-should-show-clear) .searchbar-input { |
| 308 | + /** |
| 309 | + * Padding start is based on |
| 310 | + * desired padding from design, |
| 311 | + * no leading icons. |
| 312 | + * |
| 313 | + * Padding end is based on |
| 314 | + * desired padding from design, |
| 315 | + * the size of the trailing icon (clear), |
| 316 | + * and the gap between the icon and the input. |
| 317 | + */ |
| 318 | + @include globals.padding-horizontal( |
| 319 | + globals.$ion-space-400, |
| 320 | + calc(globals.$ion-space-400 + globals.$ion-scale-400 + globals.$ion-space-200) |
| 321 | + ); |
216 | 322 | } |
217 | 323 |
|
218 | 324 | :host(.searchbar-size-medium) .searchbar-search-icon, |
|
226 | 332 | @include globals.position-horizontal(null, globals.$ion-space-400); |
227 | 333 | } |
228 | 334 |
|
| 335 | +:host(.in-toolbar.searchbar-size-small.searchbar-should-show-cancel) .searchbar-input, |
| 336 | +:host(.in-toolbar.searchbar-size-medium.searchbar-should-show-cancel) .searchbar-input { |
| 337 | + /** |
| 338 | + * Padding start is based on |
| 339 | + * the alignment of the back button, |
| 340 | + * the size of the leading icon (search or cancel), |
| 341 | + * and the gap between the icon and the input. |
| 342 | + */ |
| 343 | + padding-inline-start: calc(9px + globals.$ion-scale-400 + globals.$ion-space-200); |
| 344 | +} |
| 345 | + |
229 | 346 | /* Large */ |
230 | 347 | :host(.searchbar-size-large) .searchbar-search-icon, |
231 | 348 | :host(.searchbar-size-large) .searchbar-cancel-button { |
|
237 | 354 | font-size: globals.$ion-font-size-500; |
238 | 355 | } |
239 | 356 |
|
240 | | -:host-context(ion-toolbar).searchbar-size-large.searchbar-should-show-cancel .searchbar-input { |
| 357 | +:host(.searchbar-size-large) .searchbar-input { |
| 358 | + @include globals.padding(globals.$ion-space-400, null); |
| 359 | + |
241 | 360 | /** |
242 | 361 | * Padding start is based on |
243 | | - * the alignment of the back button, |
| 362 | + * desired padding from design, |
244 | 363 | * the size of the leading icon (search or cancel), |
245 | 364 | * and the gap between the icon and the input. |
| 365 | + * |
| 366 | + * Padding end is based on |
| 367 | + * desired padding from design, |
| 368 | + * the size of the trailing icon (clear), |
| 369 | + * and the gap between the icon and the input. |
246 | 370 | */ |
247 | | - padding-inline-start: calc(9px + globals.$ion-scale-500 + globals.$ion-space-200); |
| 371 | + @include globals.padding-horizontal(globals.$ion-space-500); |
| 372 | + |
| 373 | + height: globals.$ion-scale-1400; |
248 | 374 | } |
249 | 375 |
|
250 | | -:host(.searchbar-size-large) .searchbar-input { |
251 | | - @include globals.padding(globals.$ion-space-400, null); |
| 376 | +/* Large with Leading Icons */ |
| 377 | +:host(.searchbar-size-large.searchbar-should-show-search-icon) .searchbar-input, |
| 378 | +:host(.searchbar-size-large.searchbar-should-show-cancel) .searchbar-input { |
| 379 | + /** |
| 380 | + * Padding start is based on |
| 381 | + * desired padding from design, |
| 382 | + * the size of the leading icon (search or cancel), |
| 383 | + * and the gap between the icon and the input. |
| 384 | + * |
| 385 | + * Padding end is based on |
| 386 | + * desired padding from design, |
| 387 | + * no trailing icons. |
| 388 | + */ |
| 389 | + @include globals.padding-horizontal( |
| 390 | + calc(globals.$ion-space-500 + globals.$ion-scale-500 + globals.$ion-space-200), |
| 391 | + globals.$ion-space-500 |
| 392 | + ); |
| 393 | +} |
252 | 394 |
|
| 395 | +/* Large with Leading Icons and Trailing Icons */ |
| 396 | +:host(.searchbar-size-large.searchbar-should-show-search-icon.searchbar-should-show-clear) .searchbar-input, |
| 397 | +:host(.searchbar-size-large.searchbar-should-show-cancel.searchbar-should-show-clear) .searchbar-input { |
253 | 398 | /** |
254 | 399 | * Padding start is based on |
255 | 400 | * desired padding from design, |
|
265 | 410 | calc(globals.$ion-space-500 + globals.$ion-scale-500 + globals.$ion-space-200), |
266 | 411 | calc(globals.$ion-space-500 + globals.$ion-scale-400 + globals.$ion-space-200) |
267 | 412 | ); |
| 413 | +} |
268 | 414 |
|
269 | | - height: globals.$ion-scale-1400; |
| 415 | +/* Large with Trailing Icons */ |
| 416 | +:host(.searchbar-size-large.searchbar-should-show-clear) .searchbar-input { |
| 417 | + /** |
| 418 | + * Padding start is based on |
| 419 | + * desired padding from design, |
| 420 | + * no leading icons. |
| 421 | + * |
| 422 | + * Padding end is based on |
| 423 | + * desired padding from design, |
| 424 | + * the size of the trailing icon (clear), |
| 425 | + * and the gap between the icon and the input. |
| 426 | + */ |
| 427 | + @include globals.padding-horizontal( |
| 428 | + globals.$ion-space-500, |
| 429 | + calc(globals.$ion-space-500 + globals.$ion-scale-400 + globals.$ion-space-200) |
| 430 | + ); |
| 431 | +} |
| 432 | + |
| 433 | +:host(.in-toolbar.searchbar-size-large.searchbar-should-show-cancel) .searchbar-input { |
| 434 | + /** |
| 435 | + * Padding start is based on |
| 436 | + * the alignment of the back button, |
| 437 | + * the size of the leading icon (search or cancel), |
| 438 | + * and the gap between the icon and the input. |
| 439 | + */ |
| 440 | + padding-inline-start: calc(9px + globals.$ion-scale-500 + globals.$ion-space-200); |
270 | 441 | } |
271 | 442 |
|
272 | 443 | :host(.searchbar-size-large) .searchbar-search-icon, |
|
0 commit comments