Skip to content

fix(material/chips): chips should assume their minimum density rather than error for small densities #26688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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