Skip to content

Commit 69ab056

Browse files
committed
refactor(searchbar): update styles to match design
1 parent a82105d commit 69ab056

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

core/src/components/searchbar/searchbar.ionic.scss

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
// -----------------------------------------
2929

3030
.searchbar-search-icon {
31-
width: globals.$ion-scale-500;
32-
height: globals.$ion-scale-500;
31+
width: globals.$ion-scale-400;
32+
height: globals.$ion-scale-400;
3333
}
3434

3535
// Searchbar Input Field
@@ -59,12 +59,12 @@
5959
// -----------------------------------------
6060

6161
.searchbar-cancel-button {
62-
width: globals.$ion-scale-500;
63-
height: globals.$ion-scale-500;
62+
width: globals.$ion-scale-400;
63+
height: globals.$ion-scale-400;
6464

6565
background-color: transparent;
6666

67-
font-size: globals.$ion-font-size-500;
67+
font-size: globals.$ion-font-size-400;
6868
}
6969

7070
// Searchbar Search & Clear Icon & Cancel Icon
@@ -113,7 +113,7 @@
113113
* the size of the leading icon (search or cancel),
114114
* and the gap between the icon and the input.
115115
*/
116-
padding-inline-start: calc(9px + globals.$ion-scale-500 + globals.$ion-space-200);
116+
padding-inline-start: calc(9px + globals.$ion-scale-400 + globals.$ion-space-200);
117117
}
118118

119119
// Searchbar States
@@ -181,10 +181,7 @@
181181
* the size of the trailing icon (clear),
182182
* and the gap between the icon and the input.
183183
*/
184-
@include globals.padding-horizontal(
185-
calc(globals.$ion-space-300 + globals.$ion-scale-500 + globals.$ion-space-200),
186-
calc(globals.$ion-space-300 + globals.$ion-scale-400 + globals.$ion-space-200)
187-
);
184+
@include globals.padding-horizontal(calc(globals.$ion-space-300 + globals.$ion-scale-400 + globals.$ion-space-200));
188185

189186
height: globals.$ion-scale-1000;
190187
}
@@ -213,10 +210,7 @@
213210
* the size of the trailing icon (clear),
214211
* and the gap between the icon and the input.
215212
*/
216-
@include globals.padding-horizontal(
217-
calc(globals.$ion-space-400 + globals.$ion-scale-500 + globals.$ion-space-200),
218-
calc(globals.$ion-space-400 + globals.$ion-scale-400 + globals.$ion-space-200)
219-
);
213+
@include globals.padding-horizontal(calc(globals.$ion-space-400 + globals.$ion-scale-400 + globals.$ion-space-200));
220214

221215
height: globals.$ion-scale-1200;
222216
}
@@ -233,6 +227,26 @@
233227
}
234228

235229
/* Large */
230+
:host(.searchbar-size-large) .searchbar-search-icon,
231+
:host(.searchbar-size-large) .searchbar-cancel-button {
232+
width: globals.$ion-scale-500;
233+
height: globals.$ion-scale-500;
234+
}
235+
236+
:host(.searchbar-size-large) .searchbar-cancel-button {
237+
font-size: globals.$ion-font-size-500;
238+
}
239+
240+
:host-context(ion-toolbar).searchbar-size-large.searchbar-should-show-cancel .searchbar-input {
241+
/**
242+
* Padding start is based on
243+
* the alignment of the back button,
244+
* the size of the leading icon (search or cancel),
245+
* and the gap between the icon and the input.
246+
*/
247+
padding-inline-start: calc(9px + globals.$ion-scale-500 + globals.$ion-space-200);
248+
}
249+
236250
:host(.searchbar-size-large) .searchbar-input {
237251
@include globals.padding(globals.$ion-space-400, null);
238252

0 commit comments

Comments
 (0)