Elizabeth Mitchell d12ed3e4e3 chore(elevation)!: remove surface for tonal surface update
Changes:
- Elevation is now `inset:0;position:absolute;` by default
- Separated surface styles into a temporary `<md-elevation-surface>` element (this will be removed after tonal surface update)
PiperOrigin-RevId: 521934300
2023-04-04 20:14:24 -07:00

60 lines
1.3 KiB
SCSS

//
// Copyright 2021 Google LLC
// SPDX-License-Identifier: Apache-2.0
//
// stylelint-disable selector-class-pattern --
// Selector '.md3-*' should only be used in this project.
// go/keep-sorted start
@use '../../elevation/elevation';
// go/keep-sorted end
@mixin styles() {
.md3-button {
@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)
)
);
// apply elevation in order of focused, hovered, pressed, disabled
// this ensures a button will have hover elevation after being focused
&:focus {
@include elevation.theme(
(
level: var(--_focus-container-elevation),
)
);
}
&:hover {
@include elevation.theme(
(
level: var(--_hover-container-elevation),
)
);
}
&:active {
@include elevation.theme(
(
level: var(--_pressed-container-elevation),
)
);
}
&:disabled {
@include elevation.theme(
(
level: var(--_disabled-container-elevation),
)
);
}
}
}