Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 29 additions & 12 deletions src/material/chips/chip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -660,14 +660,37 @@ $fallbacks: m3-chip.get-tokens();
pointer-events: none;
}

}

// Targets .mdc-evolution-chip__cell
.mat-mdc-chip-action .mat-focus-indicator::before,
// Targets mdc-evolution-chip__icon
.mat-mdc-chip-action.mat-focus-indicator::before {
// For the chip element, default inset/offset values are necessary to ensure that
// the focus indicator is sufficiently contrastive and renders appropriately.
.mat-focus-indicator::before {
$default-border-width: focus-indicators-private.$default-border-width;
$border-width: var(--mat-focus-indicator-border-width, #{$default-border-width});
$offset: calc(#{$border-width} + 2px);
margin: calc(#{$offset} * -1);
}
$default-border-width: focus-indicators-private.$default-border-width;
// stylelint-disable-next-line max-line-length
$border-color: var(--mat-focus-indicator-border-color, #{focus-indicators-private.$default-border-color});
$border-width: var(--mat-focus-indicator-border-width, #{$default-border-width});
$offset: calc(#{$border-width} + 2px);

content: '';
display: block;
position: absolute;
padding: $offset;
margin: calc(#{$offset} * -1);
border-width: $border-width;
border: solid;
border-color: $border-color;
opacity: 0;
height: auto;
}

// The chip has multiple focus targets so we have to put the indicator on
// a separate element, rather than on the focusable element itself.
.mat-mdc-chip-action:focus .mat-focus-indicator::before,
.mat-mdc-chip-action.mat-focus-indicator:focus::before {
opacity: 1;
}

.mat-mdc-chip-edit, .mat-mdc-chip-remove {
Expand Down Expand Up @@ -725,12 +748,6 @@ $fallbacks: m3-chip.get-tokens();
}
}

// The chip has multiple focus targets so we have to put the indicator on
// a separate element, rather than on the focusable element itself.
.mat-mdc-chip-action:focus .mat-focus-indicator::before {
content: '';
}

// Prevents icon from being cut off when text spacing is increased.
// .mat-mdc-chip-remove selector necessary for remove button with icon.
// Fixes b/250063405.
Expand Down
Loading