|
154 | 154 | inset-block-start: 0; |
155 | 155 | inset-inline-end: 0; |
156 | 156 |
|
157 | | - &::before { |
158 | | - position: absolute; |
159 | | - display: block; |
160 | | - background-color: $field; |
161 | | - block-size: calc(100% - 2px); |
162 | | - content: ''; |
163 | | - inline-size: 2px; |
164 | | - inset-block-start: convert.to-rem(1px); |
165 | | - inset-inline-start: 0; |
166 | | - transition: background-color $duration-fast-02 |
167 | | - motion(standard, productive); |
168 | | - |
169 | | - @media screen and (prefers-reduced-motion: reduce) { |
170 | | - transition: none; |
171 | | - } |
172 | | - } |
173 | | - |
174 | 157 | &:hover { |
175 | 158 | border-block-end: 1px solid $border-strong; |
176 | | - |
177 | | - &::before { |
178 | | - background-color: $field-hover; |
179 | | - } |
180 | 159 | } |
181 | 160 | } |
182 | 161 |
|
|
191 | 170 | } |
192 | 171 | } |
193 | 172 |
|
| 173 | + // Keep the clear icon above the hover fill overlay. |
194 | 174 | .#{$prefix}--search-close svg { |
| 175 | + position: relative; |
| 176 | + z-index: 1; |
195 | 177 | fill: inherit; |
196 | 178 | } |
197 | 179 |
|
|
200 | 182 | display: flex; |
201 | 183 | align-items: center; |
202 | 184 | justify-content: center; |
203 | | - border-width: 1px 0; |
| 185 | + border-width: 0 0 1px; |
204 | 186 | border-style: solid; |
205 | 187 | border-color: transparent; |
206 | 188 | block-size: convert.to-rem(40px); |
207 | 189 | cursor: pointer; |
208 | 190 | fill: $icon-primary; |
209 | 191 | inline-size: convert.to-rem(40px); |
210 | 192 | opacity: 1; |
211 | | - transition: |
212 | | - opacity $duration-fast-02 motion(standard, productive), |
213 | | - background-color $duration-fast-02 motion(standard, productive), |
214 | | - outline $duration-fast-02 motion(standard, productive), |
215 | | - border $duration-fast-02 motion(standard, productive); |
216 | 193 | visibility: inherit; |
217 | 194 |
|
218 | 195 | &:hover { |
|
230 | 207 | } |
231 | 208 | } |
232 | 209 |
|
| 210 | + // Preserve the field focus outline while the clear button is hovered. |
| 211 | + .#{$prefix}--search-input:focus ~ .#{$prefix}--search-close:hover { |
| 212 | + background-color: transparent; |
| 213 | + border-block-end-color: transparent; |
| 214 | + outline: none; |
| 215 | + |
| 216 | + &::after { |
| 217 | + position: absolute; |
| 218 | + background-color: $field-hover; |
| 219 | + content: ''; |
| 220 | + inset-block: $spacing-01; |
| 221 | + inset-inline: 0 $spacing-01; |
| 222 | + pointer-events: none; |
| 223 | + } |
| 224 | + } |
| 225 | + |
233 | 226 | .#{$prefix}--search--disabled .#{$prefix}--search-close, |
234 | 227 | .#{$prefix}--search--disabled.#{$prefix}--search--expandable |
235 | 228 | .#{$prefix}--search-magnifier { |
|
250 | 243 | fill: $icon-on-color-disabled; |
251 | 244 | } |
252 | 245 |
|
253 | | - .#{$prefix}--search-close:focus, |
254 | | - .#{$prefix}--search-close:active { |
255 | | - &::before { |
256 | | - background-color: $focus; |
257 | | - } |
258 | | - } |
259 | | - |
260 | | - .#{$prefix}--search-input:focus ~ .#{$prefix}--search-close:hover { |
261 | | - @include focus-outline('outline'); |
262 | | - } |
263 | | - |
264 | 246 | // Small |
265 | 247 | .#{$prefix}--search--sm { |
266 | 248 | .#{$prefix}--search-close, |
|
0 commit comments