-
Notifications
You must be signed in to change notification settings - Fork 13.4k
refactor(searchbar): update according to design #30245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
0be1594
a97ead6
b71f442
859c4df
a1202e6
1c3cc35
f47153f
bfceabd
a361fc5
6a2fc08
9511dee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,16 +9,18 @@ | |
| * @prop --focus-ring-color: The color of the ring around the focused element. | ||
| * @prop --focus-ring-width: The width of the ring around the focused element. | ||
| */ | ||
| --background: #{globals.$ion-primitives-neutral-100}; | ||
| --background: #{globals.$ion-bg-neutral-subtle-default}; | ||
| --border-radius: #{globals.$ion-border-radius-400}; | ||
| --box-shadow: none; | ||
| --cancel-button-color: #{globals.$ion-primitives-neutral-800}; | ||
| --clear-button-color: #{globals.$ion-primitives-neutral-1000}; | ||
| --color: #{globals.$ion-primitives-neutral-1200}; | ||
| --icon-color: #{globals.$ion-primitives-neutral-800}; | ||
| --placeholder-color: #{globals.$ion-primitives-neutral-800}; | ||
| --icon-color: #{globals.$ion-icon-default}; | ||
OS-pedrolourenco marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --placeholder-color: #{globals.$ion-text-subtlest}; | ||
| --focus-ring-color: #{globals.$ion-border-focus-default}; | ||
| --focus-ring-width: #{globals.$ion-border-size-050}; | ||
| --leading-icon-padding: #{calc(globals.$ion-scale-400 + globals.$ion-space-200)}; | ||
| --clear-button-padding: #{calc(globals.$ion-scale-400 + globals.$ion-space-200)}; | ||
|
||
|
|
||
| @include globals.typography(globals.$ion-body-md-regular); | ||
| @include globals.padding(0); | ||
|
|
@@ -38,6 +40,8 @@ | |
| .searchbar-input { | ||
| @include globals.padding(globals.$ion-space-300, null); | ||
|
|
||
| text-overflow: ellipsis; | ||
thetaPC marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| contain: strict; | ||
| } | ||
|
|
||
|
|
@@ -55,6 +59,10 @@ | |
| contain: strict; | ||
| } | ||
|
|
||
| :host(:not(.searchbar-should-show-clear)) { | ||
| --clear-button-padding: #{globals.$ion-scale-0}; | ||
| } | ||
|
|
||
| // Searchbar Cancel Icon | ||
| // ----------------------------------------- | ||
|
|
||
|
|
@@ -67,7 +75,7 @@ | |
| font-size: globals.$ion-font-size-400; | ||
| } | ||
|
|
||
| // Searchbar Search & Clear Icon & Cancel Icon | ||
| // Searchbar Search Icon & Clear Icon & Cancel Icon | ||
| // ----------------------------------------- | ||
|
|
||
| .searchbar-search-icon, | ||
|
|
@@ -80,7 +88,7 @@ | |
| transform: translateY(-50%); | ||
| } | ||
|
|
||
| // Clear Icon & Cancel Icon | ||
| // Searchbar Clear Icon & Cancel Icon | ||
| // ----------------------------------------- | ||
|
|
||
| .searchbar-clear-button:focus-visible, | ||
|
|
@@ -92,6 +100,16 @@ | |
| opacity: 1; | ||
| } | ||
|
|
||
| // Searchbar Search Icon & Cancel Icon | ||
| // ----------------------------------------- | ||
| :host(:not(.searchbar-has-leading-icons)) { | ||
| --leading-icon-padding: #{globals.$ion-scale-0}; | ||
| } | ||
|
|
||
| :host(:not(.searchbar-has-value)) { | ||
| --icon-color: #{globals.$ion-icon-subtlest}; | ||
| } | ||
OS-pedrolourenco marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| // Searchbar in Toolbar | ||
| // ----------------------------------------- | ||
|
|
||
|
|
@@ -113,7 +131,7 @@ | |
| * the size of the leading icon (search or cancel), | ||
| * and the gap between the icon and the input. | ||
| */ | ||
| padding-inline-start: calc(9px + globals.$ion-scale-400 + globals.$ion-space-200); | ||
| padding-inline-start: calc(9px + var(--leading-icon-padding)); | ||
| } | ||
|
|
||
| // Searchbar States | ||
|
|
@@ -143,8 +161,8 @@ | |
| /* Disabled */ | ||
| :host(.searchbar-disabled) { | ||
| --color: #{globals.$ion-primitives-neutral-500}; | ||
| --icon-color: #{globals.$ion-primitives-neutral-500}; | ||
| --placeholder-color: #{globals.$ion-primitives-neutral-500}; | ||
| --icon-color: #{globals.$ion-icon-disabled}; | ||
| --placeholder-color: #{globals.$ion-text-disabled}; | ||
|
|
||
| cursor: default; | ||
| pointer-events: none; | ||
|
|
@@ -181,7 +199,10 @@ | |
| * the size of the trailing icon (clear), | ||
| * and the gap between the icon and the input. | ||
| */ | ||
| @include globals.padding-horizontal(calc(globals.$ion-space-300 + globals.$ion-scale-400 + globals.$ion-space-200)); | ||
| @include globals.padding-horizontal( | ||
| calc(globals.$ion-space-300 + var(--leading-icon-padding)), | ||
| calc(globals.$ion-space-300 + var(--clear-button-padding)) | ||
| ); | ||
|
|
||
| height: globals.$ion-scale-1000; | ||
| } | ||
|
|
@@ -210,7 +231,10 @@ | |
| * the size of the trailing icon (clear), | ||
| * and the gap between the icon and the input. | ||
| */ | ||
| @include globals.padding-horizontal(calc(globals.$ion-space-400 + globals.$ion-scale-400 + globals.$ion-space-200)); | ||
| @include globals.padding-horizontal( | ||
| calc(globals.$ion-space-400 + var(--leading-icon-padding)), | ||
| calc(globals.$ion-space-400 + var(--clear-button-padding)) | ||
| ); | ||
|
|
||
| height: globals.$ion-scale-1200; | ||
| } | ||
|
|
@@ -229,6 +253,8 @@ | |
| /* Large */ | ||
| :host(.searchbar-size-large) .searchbar-search-icon, | ||
| :host(.searchbar-size-large) .searchbar-cancel-button { | ||
| --leading-icon-padding: #{calc(globals.$ion-scale-500 + globals.$ion-space-200)}; | ||
|
|
||
| width: globals.$ion-scale-500; | ||
| height: globals.$ion-scale-500; | ||
| } | ||
|
|
@@ -244,7 +270,7 @@ | |
| * the size of the leading icon (search or cancel), | ||
| * and the gap between the icon and the input. | ||
| */ | ||
| padding-inline-start: calc(9px + globals.$ion-scale-500 + globals.$ion-space-200); | ||
| padding-inline-start: calc(9px + var(--leading-icon-padding)); | ||
| } | ||
|
|
||
| :host(.searchbar-size-large) .searchbar-input { | ||
|
|
@@ -262,8 +288,8 @@ | |
| * and the gap between the icon and the input. | ||
| */ | ||
| @include globals.padding-horizontal( | ||
| calc(globals.$ion-space-500 + globals.$ion-scale-500 + globals.$ion-space-200), | ||
| calc(globals.$ion-space-500 + globals.$ion-scale-400 + globals.$ion-space-200) | ||
| calc(globals.$ion-space-500 + var(--leading-icon-padding)), | ||
| calc(globals.$ion-space-500 + var(--clear-button-padding)) | ||
| ); | ||
|
|
||
| height: globals.$ion-scale-1400; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.