|
107 | 107 | // Searchbar in Toolbar |
108 | 108 | // ----------------------------------------- |
109 | 109 |
|
110 | | -:host-context(ion-toolbar).searchbar-should-show-cancel .searchbar-cancel-button { |
| 110 | +:host(.in-toolbar.searchbar-should-show-cancel) .searchbar-cancel-button { |
111 | 111 | /** |
112 | 112 | * The left edge of the cancel button |
113 | 113 | * should align with the left edge |
|
118 | 118 | @include globals.position-horizontal(9px, null); |
119 | 119 | } |
120 | 120 |
|
121 | | -:host-context(ion-toolbar).searchbar-should-show-cancel .searchbar-input { |
122 | | - /** |
123 | | - * Padding start is based on |
124 | | - * the alignment of the back button, |
125 | | - * the size of the leading icon (search or cancel), |
126 | | - * and the gap between the icon and the input. |
127 | | - */ |
128 | | - padding-inline-start: calc(9px + globals.$ion-scale-400 + globals.$ion-space-200); |
129 | | -} |
130 | | - |
131 | 121 | // Searchbar States |
132 | 122 | // -------------------------------------------------- |
133 | 123 |
|
|
263 | 253 |
|
264 | 254 | /* Medium */ |
265 | 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 { |
266 | 292 | /** |
267 | 293 | * Padding start is based on |
268 | 294 | * desired padding from design, |
|
275 | 301 | * and the gap between the icon and the input. |
276 | 302 | */ |
277 | 303 | @include globals.padding-horizontal(calc(globals.$ion-space-400 + globals.$ion-scale-400 + globals.$ion-space-200)); |
| 304 | +} |
278 | 305 |
|
279 | | - 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 | + ); |
280 | 322 | } |
281 | 323 |
|
282 | 324 | :host(.searchbar-size-medium) .searchbar-search-icon, |
|
290 | 332 | @include globals.position-horizontal(null, globals.$ion-space-400); |
291 | 333 | } |
292 | 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 | + |
293 | 346 | /* Large */ |
294 | 347 | :host(.searchbar-size-large) .searchbar-search-icon, |
295 | 348 | :host(.searchbar-size-large) .searchbar-cancel-button { |
|
301 | 354 | font-size: globals.$ion-font-size-500; |
302 | 355 | } |
303 | 356 |
|
304 | | -: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 | + |
305 | 360 | /** |
306 | 361 | * Padding start is based on |
307 | | - * the alignment of the back button, |
| 362 | + * desired padding from design, |
308 | 363 | * the size of the leading icon (search or cancel), |
309 | 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. |
310 | 370 | */ |
311 | | - padding-inline-start: calc(9px + globals.$ion-scale-500 + globals.$ion-space-200); |
| 371 | + @include globals.padding-horizontal(globals.$ion-space-500, globals.$ion-space-500); |
| 372 | + |
| 373 | + height: globals.$ion-scale-1400; |
312 | 374 | } |
313 | 375 |
|
314 | | -:host(.searchbar-size-large) .searchbar-input { |
315 | | - @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 | +} |
316 | 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 { |
317 | 398 | /** |
318 | 399 | * Padding start is based on |
319 | 400 | * desired padding from design, |
|
329 | 410 | calc(globals.$ion-space-500 + globals.$ion-scale-500 + globals.$ion-space-200), |
330 | 411 | calc(globals.$ion-space-500 + globals.$ion-scale-400 + globals.$ion-space-200) |
331 | 412 | ); |
| 413 | +} |
332 | 414 |
|
333 | | - 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); |
334 | 441 | } |
335 | 442 |
|
336 | 443 | :host(.searchbar-size-large) .searchbar-search-icon, |
|
0 commit comments