|
28 | 28 | // ----------------------------------------- |
29 | 29 |
|
30 | 30 | .searchbar-search-icon { |
31 | | - // Position is based on the size of the search icon. |
32 | | - @include globals.position(globals.$ion-scale-400, null, null, globals.$ion-scale-400); |
33 | | - |
34 | 31 | width: globals.$ion-scale-400; |
35 | 32 | height: globals.$ion-scale-400; |
36 | 33 | } |
|
50 | 47 | * the size of the clear icon, |
51 | 48 | * and the gap between the icon and the input. |
52 | 49 | */ |
53 | | - @include globals.padding( |
54 | | - globals.$ion-space-300, |
55 | | - calc(globals.$ion-space-400 + globals.$ion-scale-400 + globals.$ion-space-200), |
56 | | - globals.$ion-space-300, |
57 | | - calc(globals.$ion-space-400 + globals.$ion-scale-400 + globals.$ion-space-200) |
58 | | - ); |
59 | | - |
60 | | - min-height: globals.$ion-scale-1200; |
| 50 | + @include globals.padding(globals.$ion-space-300, null); |
61 | 51 |
|
62 | 52 | contain: strict; |
63 | 53 | } |
|
66 | 56 | // ----------------------------------------- |
67 | 57 |
|
68 | 58 | .searchbar-clear-button { |
69 | | - // Position is based on the size of the clear icon. |
70 | | - @include globals.position(globals.$ion-scale-400, globals.$ion-scale-400, null, null); |
71 | | - |
72 | 59 | width: globals.$ion-scale-400; |
73 | 60 | height: globals.$ion-scale-400; |
74 | 61 |
|
|
83 | 70 | // ----------------------------------------- |
84 | 71 |
|
85 | 72 | .searchbar-cancel-button { |
86 | | - /** |
87 | | - * The left edge of the cancel button |
88 | | - * should align with the left edge |
89 | | - * of the back button if the searchbar |
90 | | - * is used in a toolbar. |
91 | | - */ |
92 | | - @include globals.position(0, null, null, 9px); |
93 | | - |
94 | 73 | background-color: transparent; |
95 | 74 |
|
96 | 75 | font-size: globals.$ion-font-size-400; |
|
102 | 81 | .searchbar-search-icon, |
103 | 82 | .searchbar-clear-button, |
104 | 83 | .searchbar-cancel-button { |
| 84 | + @include globals.position(50%, null); |
| 85 | + |
105 | 86 | position: absolute; |
| 87 | + |
| 88 | + transform: translateY(-50%); |
106 | 89 | } |
107 | 90 |
|
108 | 91 | // Clear Icon & Cancel Icon |
|
117 | 100 | opacity: 1; |
118 | 101 | } |
119 | 102 |
|
120 | | -// Searchbar in Toolbar |
121 | | -// ----------------------------------------- |
122 | | - |
123 | | -:host-context(ion-toolbar) { |
124 | | - min-height: globals.$ion-scale-1200; |
125 | | -} |
126 | | - |
127 | 103 | // Searchbar States |
128 | 104 | // -------------------------------------------------- |
129 | 105 |
|
|
157 | 133 | cursor: default; |
158 | 134 | pointer-events: none; |
159 | 135 | } |
| 136 | + |
| 137 | +// Searchbar Sizes |
| 138 | +// -------------------------------------------------- |
| 139 | + |
| 140 | +/* Medium */ |
| 141 | +:host(.searchbar-size-medium) .searchbar-input { |
| 142 | + /** |
| 143 | + * Padding start is based on |
| 144 | + * desired padding from design, |
| 145 | + * the size of the search icon, |
| 146 | + * and the gap between the icon and the input. |
| 147 | + * |
| 148 | + * Padding end is based on |
| 149 | + * desired padding from design, |
| 150 | + * the size of the clear icon, |
| 151 | + * and the gap between the icon and the input. |
| 152 | + */ |
| 153 | + @include globals.padding-horizontal(calc(globals.$ion-space-400 + globals.$ion-scale-400 + globals.$ion-space-200)); |
| 154 | + |
| 155 | + min-height: globals.$ion-scale-1200; |
| 156 | +} |
| 157 | + |
| 158 | +:host(.searchbar-size-medium) .searchbar-search-icon, |
| 159 | +:host(.searchbar-size-medium) .searchbar-cancel-button { |
| 160 | + // Start is based on the desired padding start from design. |
| 161 | + @include globals.position-horizontal(globals.$ion-space-400, null); |
| 162 | +} |
| 163 | + |
| 164 | +:host(.searchbar-size-medium) .searchbar-clear-button { |
| 165 | + // End is based on the desired padding end from design. |
| 166 | + @include globals.position-horizontal(null, globals.$ion-scale-400); |
| 167 | +} |
| 168 | + |
| 169 | +/* Large */ |
| 170 | +:host(.searchbar-size-large) .searchbar-input { |
| 171 | + /** |
| 172 | + * Padding start is based on |
| 173 | + * desired padding from design, |
| 174 | + * the size of the search icon, |
| 175 | + * and the gap between the icon and the input. |
| 176 | + * |
| 177 | + * Padding end is based on |
| 178 | + * desired padding from design, |
| 179 | + * the size of the clear icon, |
| 180 | + * and the gap between the icon and the input. |
| 181 | + */ |
| 182 | + @include globals.padding-horizontal(calc(globals.$ion-space-500 + globals.$ion-scale-400 + globals.$ion-space-200)); |
| 183 | + |
| 184 | + min-height: globals.$ion-scale-1400; |
| 185 | +} |
| 186 | + |
| 187 | +:host(.searchbar-size-large) .searchbar-search-icon, |
| 188 | +:host(.searchbar-size-large) .searchbar-cancel-button { |
| 189 | + // Start is based on the desired padding start from design. |
| 190 | + @include globals.position-horizontal(globals.$ion-space-500, null); |
| 191 | +} |
| 192 | + |
| 193 | +:host(.searchbar-size-large) .searchbar-clear-button { |
| 194 | + // End is based on the desired padding end from design. |
| 195 | + @include globals.position-horizontal(null, globals.$ion-scale-500); |
| 196 | +} |
0 commit comments