Skip to content
Open
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 src/dev-app/chips/chips-demo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}

.mat-mdc-basic-chip {
margin: auto 10px;
margin: 8px 10px;
}

mat-chip-grid input {
Expand Down
1 change: 1 addition & 0 deletions src/material/chips/chip-option.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<ng-content></ng-content>
<span class="mat-mdc-chip-primary-focus-indicator mat-focus-indicator"></span>
</span>
<span class="mat-mdc-chip-touch-target"></span>
</button>
</span>

Expand Down
1 change: 1 addition & 0 deletions src/material/chips/chip-row.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

<span class="mat-mdc-chip-primary-focus-indicator mat-focus-indicator" aria-hidden="true"></span>
</span>
<span class="mat-mdc-chip-touch-target"></span>
</span>

@if (_hasTrailingIcon()) {
Expand Down
2 changes: 1 addition & 1 deletion src/material/chips/chip-set.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}

.mdc-evolution-chip {
margin: 4px 0 4px 8px;
margin: 8px 0 8px 8px;
}

[dir='rtl'] & {
Expand Down
1 change: 1 addition & 0 deletions src/material/chips/chip.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ng-content></ng-content>
<span class="mat-mdc-chip-primary-focus-indicator mat-focus-indicator"></span>
</span>
<span class="mat-mdc-chip-touch-target"></span>
</span>
</span>

Expand Down
23 changes: 23 additions & 0 deletions src/material/chips/chip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ $_graphic-padding: 6px;
$_trailing-action-padding: 8px;
$_avatar-leading-padding: 4px;
$_avatar-trailing-padding: 8px;
$_touch-target-size: 48px;
$_touch-target-vertical-padding: 8px;

$fallbacks: m3-chip.get-tokens();

Expand All @@ -27,6 +29,27 @@ $fallbacks: m3-chip.get-tokens();
max-width: 100%;
}

.mat-mdc-standard-chip,
.mat-mdc-basic-chip,
.mat-mdc-evolution-chip {
// Ensures basic/unstyled chips also have a 32px min-height baseline.
min-height: 32px;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break the density system for the chips. The way we handled it for other components was to hide the touch target at lower densities.


// 8px top and bottom margin for 48px touch target separation.
margin-top: $_touch-target-vertical-padding;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this margin actually apply? I tried pasting in the styles and it seems to be overridden.

margin-bottom: $_touch-target-vertical-padding;
}

.mat-mdc-chip-touch-target {
position: absolute;
top: 50%;
left: 0;
right: 0;
height: $_touch-target-size;
transform: translateY(-50%);
pointer-events: auto;
}

.mdc-evolution-chip__cell,
.mdc-evolution-chip__action {
height: 100%;
Expand Down
Loading