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: 16px 10px;
}

mat-chip-grid input {
Expand Down
8 changes: 7 additions & 1 deletion src/material/chips/_m2-chip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
@function get-tokens($theme) {
$system: m2-utils.get-system($theme);
$density-scale: theming.clamp-density(map.get($system, density-scale), -2);
$touch-target-display: block;

@if $density-scale < 0 {
$touch-target-display: none;
}

@return (
base: (
Expand Down Expand Up @@ -43,7 +48,8 @@
chip-container-height: map.get((
0: 32px,
-1: 28px,
-2: 24px), $density-scale)
-2: 24px), $density-scale),
chip-touch-target-display: $touch-target-display,
),
);
}
Expand Down
1 change: 1 addition & 0 deletions src/material/chips/_m3-chip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,6 @@

@return (
chip-container-height: list.nth((32px, 28px, 24px), $index),
chip-touch-target-display: list.nth((block, none, none), $index),
);
}
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
12 changes: 12 additions & 0 deletions src/material/chips/chip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ $_graphic-padding: 6px;
$_trailing-action-padding: 8px;
$_avatar-leading-padding: 4px;
$_avatar-trailing-padding: 8px;
$_touch-target-size: 48px;

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

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

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

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