Skip to content

Commit

Permalink
fix(chips): tonal surface update
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 522235924
  • Loading branch information
asyncLiz authored and copybara-github committed Apr 6, 2023
1 parent 4f9df51 commit 60ef2ab
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 29 deletions.
32 changes: 13 additions & 19 deletions chips/lib/_shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,14 @@
display: inline-flex;
height: var(--_container-height);

@include elevation.theme(
(
surface-tint: var(--_container-surface-tint-layer-color),
)
);

@include ripple.theme(
(
focus-color: var(--_focus-state-layer-color),
focus-opacity: var(--_focus-state-layer-opacity),
hover-color: var(--_hover-state-layer-color),
hover-opacity: var(--_hover-state-layer-opacity),
pressed-color: var(--_pressed-state-layer-color),
pressed-opacity: var(--_pressed-state-layer-opacity),
'focus-color': var(--_focus-state-layer-color),
'focus-opacity': var(--_focus-state-layer-opacity),
'hover-color': var(--_hover-state-layer-color),
'hover-opacity': var(--_hover-state-layer-opacity),
'pressed-color': var(--_pressed-state-layer-color),
'pressed-opacity': var(--_pressed-state-layer-opacity),
)
);
}
Expand Down Expand Up @@ -90,8 +84,8 @@
.elevated {
@include elevation.theme(
(
level: var(--_elevated-container-elevation),
shadow-color: var(--_elevated-container-shadow-color),
'level': var(--_elevated-container-elevation),
'shadow-color': var(--_elevated-container-shadow-color),
)
);
}
Expand All @@ -103,31 +97,31 @@
.elevated:hover {
@include elevation.theme(
(
level: var(--_elevated-hover-container-elevation),
'level': var(--_elevated-hover-container-elevation),
)
);
}

.elevated:focus-within {
@include elevation.theme(
(
level: var(--_elevated-focus-container-elevation),
'level': var(--_elevated-focus-container-elevation),
)
);
}

.elevated:active {
@include elevation.theme(
(
level: var(--_elevated-pressed-container-elevation),
'level': var(--_elevated-pressed-container-elevation),
)
);
}

.elevated.disabled {
@include elevation.theme(
(
level: var(--_elevated-disabled-container-elevation),
'level': var(--_elevated-disabled-container-elevation),
)
);
}
Expand All @@ -140,7 +134,7 @@
md-focus-ring {
@include focus-ring.theme(
(
shape: shape.corners-to-shape-token('--_container-shape'),
'shape': shape.corners-to-shape-token('--_container-shape'),
)
);
}
Expand Down
4 changes: 2 additions & 2 deletions chips/lib/chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import '../../elevation/elevation-surface.js';
import '../../elevation/elevation.js';
import '../../focus/focus-ring.js';
import '../../ripple/ripple.js';

Expand Down Expand Up @@ -49,7 +49,7 @@ export class Chip extends LitElement {
@focus=${this.handleFocus}
@pointerdown=${this.handlePointerDown}
${ripple(this.getRipple)}>
<md-elevation-surface shadow=${this.elevated}></md-elevation-surface>
${this.elevated ? html`<md-elevation></md-elevation>` : nothing}
${when(this.showRipple, this.renderRipple)}
<md-focus-ring .visible=${this.showFocusRing}></md-focus-ring>
<span class="icon leading">
Expand Down
6 changes: 2 additions & 4 deletions tokens/_md-comp-assist-chip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,19 @@
// go/keep-sorted end
// go/keep-sorted start
@use '../sass/shape';
@use './md-sys-color';
@use './md-sys-elevation';
@use './md-sys-shape';
@use './md-sys-state';
@use './md-sys-typescale';
// TODO(b/272526637): tonal surface update
@use './v0_161/md-comp-assist-chip';
@use './v0_161/md-sys-color';
@use './v0_172/md-comp-assist-chip';
@use './values';
// go/keep-sorted end

$supported-tokens: (
// go/keep-sorted start
'container-height',
'container-shape',
'container-surface-tint-layer-color',
'disabled-label-text-color',
'disabled-label-text-opacity',
'disabled-leading-icon-color',
Expand Down
6 changes: 2 additions & 4 deletions tokens/_md-comp-suggestion-chip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,19 @@
// go/keep-sorted end
// go/keep-sorted start
@use '../sass/shape';
@use './md-sys-color';
@use './md-sys-elevation';
@use './md-sys-shape';
@use './md-sys-state';
@use './md-sys-typescale';
// TODO(b/272526637): tonal surface update
@use './v0_161/md-comp-suggestion-chip';
@use './v0_161/md-sys-color';
@use './v0_172/md-comp-suggestion-chip';
@use './values';
// go/keep-sorted end

$supported-tokens: (
// go/keep-sorted start
'container-height',
'container-shape',
'container-surface-tint-layer-color',
'disabled-label-text-color',
'disabled-label-text-opacity',
'disabled-leading-icon-color',
Expand Down

0 comments on commit 60ef2ab

Please sign in to comment.