Skip to content

Commit f9ac3dd

Browse files
committed
fix(chips): remove visible overflow for labels
1 parent 8e9fc04 commit f9ac3dd

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/material/chips/chip.scss

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -547,15 +547,6 @@ $fallbacks: m3-chip.get-tokens();
547547
.mat-mdc-standard-chip {
548548
-webkit-tap-highlight-color: transparent;
549549

550-
// MDC sets `overflow: hidden` on these elements in order to truncate the text. This is
551-
// unnecessary since our chips don't truncate their text and it makes it difficult to style
552-
// the strong focus indicators so we need to override it.
553-
.mdc-evolution-chip__cell--primary,
554-
.mdc-evolution-chip__action--primary,
555-
.mat-mdc-chip-action-label {
556-
overflow: visible;
557-
}
558-
559550
// MDC sizes and positions this element using `width`, `height` and `padding`.
560551
// This usually works, but it's common for apps to add `box-sizing: border-box`
561552
// to all elements on the page which can cause the graphic to be clipped.

src/material/core/focus-indicators/_private.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ $default-border-radius: 4px;
8686
$config: map.merge($default-config, $config);
8787

8888
@include _customize-focus-indicators($config);
89+
90+
@include _chip-label-overflow-visible();
8991
}
9092

9193
@mixin strong-focus-indicators-color($theme-or-color) {
@@ -108,3 +110,13 @@ $default-border-radius: 4px;
108110
}
109111
}
110112
}
113+
114+
@mixin _chip-label-overflow-visible {
115+
// MDC sets `overflow: hidden` on these elements in order to truncate the text. This conflicts
116+
// with how we structure and style the strong focus indicators so we need to override it.
117+
.mdc-evolution-chip__cell--primary,
118+
.mdc-evolution-chip__action--primary,
119+
.mat-mdc-chip-action-label {
120+
overflow: visible;
121+
}
122+
}

0 commit comments

Comments
 (0)