Skip to content

Commit fd32e3f

Browse files
committed
fix(input-group): make sure that the input of type search does not interfere with the outline variant
1 parent 4bcd3bb commit fd32e3f

File tree

1 file changed

+30
-12
lines changed

1 file changed

+30
-12
lines changed

src/components/input/themes/shared/input.material.scss

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,24 @@ input:placeholder-shown + [part='notch'] [part='label'],
278278
}
279279
}
280280

281+
:host([outlined][type='search']) {
282+
[part~='labelled'] [part~='input'] {
283+
padding-top: rem(20px);
284+
padding-bottom: rem(6px);
285+
}
286+
287+
input:placeholder-shown + [part='notch'] [part='label'],
288+
[part~='filled'] + [part='notch'] [part='label'] {
289+
transform: translateY(-73%);
290+
}
291+
}
292+
293+
:host([outlined][type='search']:focus-within) {
294+
[part='notch'] [part='label'] {
295+
transform: translateY(-73%);
296+
}
297+
}
298+
281299
:host(:disabled[type='search']),
282300
:host([disabled][type='search']) {
283301
[part^='container'] {
@@ -287,7 +305,7 @@ input:placeholder-shown + [part='notch'] [part='label'],
287305
}
288306
}
289307

290-
:host([outlined]) {
308+
:host(:not([type='search'])[outlined]) {
291309
[part^='container'] {
292310
border-radius: var-get($theme, 'border-border-radius');
293311
background: var-get($theme, 'border-background');
@@ -360,7 +378,7 @@ input:placeholder-shown + [part='notch'] [part='label'],
360378
}
361379
}
362380

363-
:host([readonly][outlined]:focus-within) {
381+
:host(:not([type='search'])[readonly][outlined]:focus-within) {
364382
:not([part~='filled']) {
365383
input:not(:placeholder-shown) + [part='notch'] [part='label'] {
366384
transform: translate(0);
@@ -376,7 +394,7 @@ input:placeholder-shown + [part='notch'] [part='label'],
376394
}
377395
}
378396

379-
:host([outlined]:focus-within) {
397+
:host(:not([type='search'])[outlined]:focus-within) {
380398
[part='label'] {
381399
margin-block-start: calc(#{$active-border-width} / 2);
382400
}
@@ -423,9 +441,9 @@ input:placeholder-shown + [part='notch'] [part='label'],
423441
}
424442
}
425443

426-
:host([outlined]:active),
427-
:host([outlined]:focus),
428-
:host([outlined]:focus-within) {
444+
:host(:not([type='search'])[outlined]:active),
445+
:host(:not([type='search'])[outlined]:focus),
446+
:host(:not([type='search'])[outlined]:focus-within) {
429447
[part='suffix'] {
430448
margin-inline-end: rem(-1px);
431449
}
@@ -442,8 +460,8 @@ input:placeholder-shown + [part='notch'] [part='label'],
442460
}
443461
}
444462

445-
:host([outlined][invalid]),
446-
:host([outlined][invalid]:focus-within) {
463+
:host(:not([type='search'])[outlined][invalid]),
464+
:host(:not([type='search'])[outlined][invalid]:focus-within) {
447465
[part='start'],
448466
[part='notch'],
449467
[part='filler'],
@@ -457,13 +475,13 @@ input:placeholder-shown + [part='notch'] [part='label'],
457475
}
458476
}
459477

460-
:host([outlined][invalid]:focus-within) {
478+
:host(:not([type='search'])[outlined][invalid]:focus-within) {
461479
[part='notch'] {
462480
border-top: $idle-border-width solid transparent;
463481
}
464482
}
465483

466-
:host([readonly][outlined][invalid]:focus-within) {
484+
:host(:not([type='search'])[readonly][outlined][invalid]:focus-within) {
467485
input:not(:placeholder-shown) + [part='notch'] {
468486
border: {
469487
width: $active-border-width;
@@ -479,8 +497,8 @@ input:placeholder-shown + [part='notch'] [part='label'],
479497
}
480498
}
481499

482-
:host(:disabled[outlined]),
483-
:host([disabled][outlined]) {
500+
:host(:not([type='search']):disabled[outlined]),
501+
:host(:not([type='search'])[disabled][outlined]) {
484502
[part='start'],
485503
[part='filler'],
486504
[part='notch'],

0 commit comments

Comments
 (0)