Skip to content

Commit 19572bd

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

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393

9494
@mixin density($config-or-theme) {
9595
$density-scale: theming.get-density-config($config-or-theme);
96+
$density-scale: theming.clamp-density($density-scale, -2);
9697
.mat-mdc-chip {
9798
@include mdc-chip-theme.density($density-scale, $query: mdc-helpers.$mdc-base-styles-query);
9899
}

0 commit comments

Comments
 (0)