Skip to content

Commit 15f7637

Browse files
committed
fix(material/chips): chips should assume their minimum density rather than error for small densities
1 parent f7a5bcb commit 15f7637

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/dev-app/dev-app/dev-app-layout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export class DevAppLayout {
130130
currentDensityIndex = 0;
131131

132132
/** List of possible global density scale values. */
133-
densityScales = [0, -1, -2, 'minimum', 'maximum'];
133+
densityScales = [0, -1, -2, -3, 'minimum', 'maximum'];
134134

135135
/** Whether animations are disabled. */
136136
animationsDisabled = localStorage.getItem(ANIMATIONS_STORAGE_KEY) === 'true';

src/dev-app/theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ $candy-app-theme: mat.define-light-theme((
7575
// Create classes for all density scales which are supported by all MDC-based components.
7676
// The classes are applied conditionally based on the selected density in the dev-app layout
7777
// component.
78-
$density-scales: (-1, -2, minimum, maximum);
78+
$density-scales: (-1, -2, -3, minimum, maximum);
7979
@each $density in $density-scales {
8080
.demo-density-#{$density} {
8181
@include mat.all-component-densities($density);

src/material/chips/_chips-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
}
9393

9494
@mixin density($config-or-theme) {
95-
$density-scale: theming.get-density-config($config-or-theme);
95+
$density-scale: theming.clamp-density(theming.get-density-config($config-or-theme), -2);
9696
.mat-mdc-chip {
9797
@include mdc-chip-theme.density($density-scale, $query: mdc-helpers.$mdc-base-styles-query);
9898
}

0 commit comments

Comments
 (0)