Skip to content

Commit e986338

Browse files
committed
refactor(searchbar): update icon sizes
1 parent 733876a commit e986338

File tree

34 files changed

+41
-25
lines changed

34 files changed

+41
-25
lines changed

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

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

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

3535
// Searchbar Input Field
@@ -72,21 +72,7 @@
7272
.searchbar-cancel-button {
7373
background-color: transparent;
7474

75-
font-size: globals.$ion-font-size-400;
76-
}
77-
78-
// Searchbar Cancel Icon in Toolbar
79-
// -----------------------------------------
80-
81-
:host-context(ion-toolbar).searchbar-should-show-cancel .searchbar-cancel-button {
82-
/**
83-
* The left edge of the cancel button
84-
* should align with the left edge
85-
* of the back button if the searchbar
86-
* is used in a toolbar regardless of
87-
* the searchbar size.
88-
*/
89-
@include globals.position-horizontal(9px, null);
75+
font-size: globals.$ion-font-size-500;
9076
}
9177

9278
// Searchbar Search & Clear Icon & Cancel Icon
@@ -114,6 +100,30 @@
114100
opacity: 1;
115101
}
116102

103+
// Searchbar in Toolbar
104+
// -----------------------------------------
105+
106+
:host-context(ion-toolbar).searchbar-should-show-cancel .searchbar-cancel-button {
107+
/**
108+
* The left edge of the cancel button
109+
* should align with the left edge
110+
* of the back button if the searchbar
111+
* is used in a toolbar regardless of
112+
* the searchbar size.
113+
*/
114+
@include globals.position-horizontal(9px, null);
115+
}
116+
117+
:host-context(ion-toolbar).searchbar-should-show-cancel .searchbar-input {
118+
/**
119+
* Padding start is based on
120+
* the alignment of the back button,
121+
* the size of the leading icon (search or cancel),
122+
* and the gap between the icon and the input.
123+
*/
124+
padding-inline-start: calc(9px + globals.$ion-scale-500 + globals.$ion-space-200);
125+
}
126+
117127
// Searchbar States
118128
// --------------------------------------------------
119129

@@ -171,15 +181,18 @@
171181
/**
172182
* Padding start is based on
173183
* desired padding from design,
174-
* the size of the search icon,
184+
* the size of the leading icon (search or cancel),
175185
* and the gap between the icon and the input.
176186
*
177187
* Padding end is based on
178188
* desired padding from design,
179-
* the size of the clear icon,
189+
* the size of the trailing icon (clear),
180190
* and the gap between the icon and the input.
181191
*/
182-
@include globals.padding-horizontal(calc(globals.$ion-space-400 + globals.$ion-scale-400 + globals.$ion-space-200));
192+
@include globals.padding-horizontal(
193+
calc(globals.$ion-space-400 + globals.$ion-scale-500 + globals.$ion-space-200),
194+
calc(globals.$ion-space-400 + globals.$ion-scale-400 + globals.$ion-space-200)
195+
);
183196

184197
min-height: globals.$ion-scale-1200;
185198
}
@@ -192,23 +205,26 @@
192205

193206
:host(.searchbar-size-medium) .searchbar-clear-button {
194207
// End is based on the desired padding end from design.
195-
@include globals.position-horizontal(null, globals.$ion-scale-400);
208+
@include globals.position-horizontal(null, globals.$ion-space-400);
196209
}
197210

198211
/* Large */
199212
:host(.searchbar-size-large) .searchbar-input {
200213
/**
201214
* Padding start is based on
202215
* desired padding from design,
203-
* the size of the search icon,
216+
* the size of the leading icon (search or cancel),
204217
* and the gap between the icon and the input.
205218
*
206219
* Padding end is based on
207220
* desired padding from design,
208-
* the size of the clear icon,
221+
* the size of the trailing icon (clear),
209222
* and the gap between the icon and the input.
210223
*/
211-
@include globals.padding-horizontal(calc(globals.$ion-space-500 + globals.$ion-scale-400 + globals.$ion-space-200));
224+
@include globals.padding-horizontal(
225+
calc(globals.$ion-space-500 + globals.$ion-scale-500 + globals.$ion-space-200),
226+
calc(globals.$ion-space-500 + globals.$ion-scale-400 + globals.$ion-space-200)
227+
);
212228

213229
min-height: globals.$ion-scale-1400;
214230
}
@@ -221,5 +237,5 @@
221237

222238
:host(.searchbar-size-large) .searchbar-clear-button {
223239
// End is based on the desired padding end from design.
224-
@include globals.position-horizontal(null, globals.$ion-scale-500);
240+
@include globals.position-horizontal(null, globals.$ion-space-500);
225241
}
Loading
Loading
Loading
86 Bytes
Loading
40 Bytes
Loading
73 Bytes
Loading
89 Bytes
Loading
43 Bytes
Loading
78 Bytes
Loading

0 commit comments

Comments
 (0)