Skip to content

Commit

Permalink
fix(button): tonal surface update
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 522243314
  • Loading branch information
asyncLiz authored and copybara-github committed Apr 6, 2023
1 parent 92a9071 commit 50157e6
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 28 deletions.
15 changes: 7 additions & 8 deletions button/lib/_elevation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
@include elevation.theme(
(
// TODO: replace duration with animation tokens
duration: 280ms,
level: var(--_container-elevation),
shadow-color: var(--_container-shadow-color),
surface-tint: var(--_container-surface-tint-layer-color)
'duration': 280ms,
'level': var(--_container-elevation),
'shadow-color': var(--_container-shadow-color)
)
);

Expand All @@ -27,31 +26,31 @@
&:focus {
@include elevation.theme(
(
level: var(--_focus-container-elevation),
'level': var(--_focus-container-elevation),
)
);
}

&:hover {
@include elevation.theme(
(
level: var(--_hover-container-elevation),
'level': var(--_hover-container-elevation),
)
);
}

&:active {
@include elevation.theme(
(
level: var(--_pressed-container-elevation),
'level': var(--_pressed-container-elevation),
)
);
}

&:disabled {
@include elevation.theme(
(
level: var(--_disabled-container-elevation),
'level': var(--_disabled-container-elevation),
)
);
}
Expand Down
1 change: 0 additions & 1 deletion button/lib/_shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
.md3-button::after,
.md3-button::before,
md-elevation,
md-elevation-surface,
.md3-button__ripple {
z-index: -1; // Place behind content
}
Expand Down
4 changes: 2 additions & 2 deletions button/lib/elevated-button.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 {html, TemplateResult} from 'lit';
import {ClassInfo} from 'lit/directives/class-map.js';
Expand All @@ -23,6 +23,6 @@ export class ElevatedButton extends Button {
}

protected override renderElevation(): TemplateResult {
return html`<md-elevation-surface shadow></md-elevation-surface>`;
return html`<md-elevation></md-elevation>`;
}
}
4 changes: 2 additions & 2 deletions button/lib/filled-button.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 {html, TemplateResult} from 'lit';
import {ClassInfo} from 'lit/directives/class-map.js';
Expand All @@ -23,6 +23,6 @@ export class FilledButton extends Button {
}

protected override renderElevation(): TemplateResult {
return html`<md-elevation-surface shadow></md-elevation-surface>`;
return html`<md-elevation></md-elevation>`;
}
}
5 changes: 2 additions & 3 deletions tokens/_md-comp-elevated-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
// 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-elevated-button';
@use './v0_161/md-sys-color';
@use './v0_172/md-comp-elevated-button';
@use './values';
// go/keep-sorted end

Expand Down
5 changes: 2 additions & 3 deletions tokens/_md-comp-filled-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
// 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-filled-button';
@use './v0_161/md-sys-color';
@use './v0_172/md-comp-filled-button';
@use './values';
// go/keep-sorted end

Expand Down
5 changes: 2 additions & 3 deletions tokens/_md-comp-filled-tonal-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
// 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-filled-tonal-button';
@use './v0_161/md-sys-color';
@use './v0_172/md-comp-filled-tonal-button';
@use './values';
// go/keep-sorted end

Expand Down
5 changes: 2 additions & 3 deletions tokens/_md-comp-outlined-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
// go/keep-sorted end
// go/keep-sorted start
@use '../sass/shape';
@use './md-sys-color';
@use './md-sys-shape';
@use './md-sys-state';
@use './md-sys-typescale';
// TODO(b/272526637): tonal surface update
@use './v0_161/md-comp-outlined-button';
@use './v0_161/md-sys-color';
@use './v0_172/md-comp-outlined-button';
@use './values';
// go/keep-sorted end

Expand Down
5 changes: 2 additions & 3 deletions tokens/_md-comp-text-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
// go/keep-sorted end
// go/keep-sorted start
@use '../sass/shape';
@use './md-sys-color';
@use './md-sys-shape';
@use './md-sys-state';
@use './md-sys-typescale';
// TODO(b/272526637): tonal surface update
@use './v0_161/md-comp-text-button';
@use './v0_161/md-sys-color';
@use './v0_172/md-comp-text-button';
@use './values';
// go/keep-sorted end

Expand Down

0 comments on commit 50157e6

Please sign in to comment.