Skip to content

Commit 1442854

Browse files
committed
refactor(material/chips): updates ::after styles and fix lint errors
Updates Angular Component Chips component fix to change ::after background property changes to be background-color specifically to avoid overriding background-clip styles. Suppresses lint warning material/no-prefixes for background-clip since it's majority compatible with browsers. Fixes b/286959517
1 parent 6e5a590 commit 1442854

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/material/chips/chip.scss

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ $_avatar-trailing-padding: 8px;
538538
}
539539

540540
&::after {
541-
@include token-utils.create-token-slot(background, trailing-action-state-layer-color);
541+
@include token-utils.create-token-slot(background-color, trailing-action-state-layer-color);
542542
}
543543

544544
&:hover::after {
@@ -552,7 +552,8 @@ $_avatar-trailing-padding: 8px;
552552

553553
.mat-mdc-chip-selected .mat-mdc-chip-remove::after,
554554
.mat-mdc-chip-highlighted .mat-mdc-chip-remove::after {
555-
@include token-utils.create-token-slot(background, selected-trailing-action-state-layer-color);
555+
@include token-utils.create-token-slot(background-color,
556+
selected-trailing-action-state-layer-color);
556557
}
557558
}
558559

@@ -697,17 +698,20 @@ $_avatar-trailing-padding: 8px;
697698
&::after {
698699
$_touch-target-size: 48px;
699700
$_ripple-size: 24px;
701+
$offset: 3px;
700702
content: '';
701703
display: block;
702704
opacity: 0;
703705
position: absolute;
704-
// Increases touch target size to improve accessibility and fix b/286959517
705-
z-index: 100;
706-
pointer-events: all;
706+
top: 0 - $offset;
707+
bottom: 0 - $offset;
708+
left: 8px - $offset;
709+
right: 8px - $offset;
710+
border-radius: 50%;
707711
box-sizing: border-box;
708712
padding: calc(($_touch-target-size - $_ripple-size)/2);
709713
margin: calc((($_touch-target-size - $_ripple-size)/2) * -1);
710-
-webkit-background-clip: content-box;
714+
// stylelint-disable material/no-prefixes
711715
background-clip: content-box;
712716
}
713717

0 commit comments

Comments
 (0)