- ${
- when(this.range, () => this.renderHandle(handleAProps))}
+ ${when(this.range, () => this.renderHandle(handleAProps))}
${this.renderHandle(handleBProps)}
@@ -396,8 +395,8 @@ export class Slider extends LitElement {
${ripple(getRipple)}>`;
}
- private readonly renderRipple = (id: string) => html`
`;
+ private readonly renderRipple = (id: string) =>
+ html`
`;
private readonly getRippleA = () => { // bind to this
if (!this.handleAHover) {
diff --git a/switch/lib/_handle.scss b/switch/lib/_handle.scss
index 03d3ba5f95..3e524cad6a 100644
--- a/switch/lib/_handle.scss
+++ b/switch/lib/_handle.scss
@@ -16,10 +16,11 @@ $_easing-standard: map.get($_md-sys-motion, 'easing-standard');
@mixin styles() {
.handle-container {
+ display: grid;
+ place-items: center;
position: relative;
// this easing is custom to perform the "overshoot" animation
transition: margin 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
- display: flex;
}
$margin: calc(var(--_track-width) - var(--_track-height));
@@ -127,21 +128,14 @@ $_easing-standard: map.get($_md-sys-motion, 'easing-standard');
opacity: var(--_disabled-unselected-handle-opacity);
}
- .ripple {
- position: absolute;
- display: inline-flex;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- height: var(--_state-layer-size);
- width: var(--_state-layer-size);
- }
-
md-ripple {
border-radius: var(--_state-layer-shape);
+ height: var(--_state-layer-size);
+ inset: unset;
+ width: var(--_state-layer-size);
}
- .switch--selected .ripple {
+ .switch--selected md-ripple {
@include ripple.theme(
(
'hover-color': var(--_selected-hover-state-layer-color),
@@ -154,7 +148,7 @@ $_easing-standard: map.get($_md-sys-motion, 'easing-standard');
);
}
- .switch--unselected .ripple {
+ .switch--unselected md-ripple {
@include ripple.theme(
(
'hover-color': var(--_unselected-hover-state-layer-color),
diff --git a/switch/lib/_switch.scss b/switch/lib/_switch.scss
index 547edd71be..ee99b2c316 100644
--- a/switch/lib/_switch.scss
+++ b/switch/lib/_switch.scss
@@ -122,11 +122,8 @@
// Touch target
.touch {
position: absolute;
- top: 50%;
height: 48px;
- left: 50%;
width: 48px;
- transform: translate(-50%, -50%);
}
// Disabled
diff --git a/switch/lib/switch.ts b/switch/lib/switch.ts
index f6c117c0b5..8cbe61d3a2 100644
--- a/switch/lib/switch.ts
+++ b/switch/lib/switch.ts
@@ -152,14 +152,7 @@ export class Switch extends LitElement {
}
private readonly renderRipple = () => {
- return html`
-
-
-
-
- `;
+ return html`
`;
};
private readonly getRipple = () => {