Skip to content

Commit c4c57f7

Browse files
authored
fix(material/chips): chips should assume their minimum density rather than error for small densities (#26688)
1 parent 8a32172 commit c4c57f7

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"license": "MIT",
1111
"engines": {
12-
"node": ">=14.0.0 <17.0.0",
12+
"node": ">=14.0.0 <19.0.0",
1313
"yarn": "^1.22.17",
1414
"npm": "Please use Yarn instead of NPM to install dependencies. See: https://yarnpkg.com/lang/en/docs/install/"
1515
},

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)