Skip to content

Commit

Permalink
fix(material/chips): chips should assume their minimum density rather…
Browse files Browse the repository at this point in the history
… than error for small densities (#26688)

(cherry picked from commit c4c57f7)
  • Loading branch information
mmalerba committed Feb 28, 2023
1 parent d61443b commit fdf1dc4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"license": "MIT",
"engines": {
"node": ">=14.0.0 <17.0.0",
"node": ">=14.0.0 <19.0.0",
"yarn": "^1.22.17",
"npm": "Please use Yarn instead of NPM to install dependencies. See: https://yarnpkg.com/lang/en/docs/install/"
},
Expand Down
2 changes: 1 addition & 1 deletion src/dev-app/dev-app/dev-app-layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class DevAppLayout {
currentDensityIndex = 0;

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

/** Whether animations are disabled. */
animationsDisabled = localStorage.getItem(ANIMATIONS_STORAGE_KEY) === 'true';
Expand Down
2 changes: 1 addition & 1 deletion src/dev-app/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ $candy-app-theme: mat.define-light-theme((
// Create classes for all density scales which are supported by all MDC-based components.
// The classes are applied conditionally based on the selected density in the dev-app layout
// component.
$density-scales: (-1, -2, minimum, maximum);
$density-scales: (-1, -2, -3, minimum, maximum);
@each $density in $density-scales {
.demo-density-#{$density} {
@include mat.all-component-densities($density);
Expand Down
1 change: 1 addition & 0 deletions src/material/chips/_chips-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@

@mixin density($config-or-theme) {
$density-scale: theming.get-density-config($config-or-theme);
$density-scale: theming.clamp-density($density-scale, -2);
.mat-mdc-chip {
@include mdc-chip-theme.density($density-scale, $query: mdc-helpers.$mdc-base-styles-query);
}
Expand Down

0 comments on commit fdf1dc4

Please sign in to comment.