Skip to content
Closed
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
21 changes: 21 additions & 0 deletions src/material/slide-toggle/slide-toggle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@ $fallbacks: m3-slide-toggle.get-tokens();
padding: 0;
position: relative;

&::after {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that the slide toggle's touch target is determined by the token slide-toggle-state-layer-size. If we just increase it to 48px for density: 0, doesn't that resolve this in the same way?

$_touch-target-size: 48px;
$_ripple-size: 24px;
$offset: 5px;

content: '';
opacity: 0;
display: block;
position: absolute;
top: 0 - $offset;
bottom: 0 - $offset;
left: $offset;
right: $offset;
border-radius: 50%;
box-sizing: border-box;
padding: calc(($_touch-target-size - $_ripple-size)/2);
margin: calc((($_touch-target-size - $_ripple-size)/2) * -1);
// stylelint-disable material/no-prefixes
background-clip: content-box;
}

width: token-utils.slot(slide-toggle-track-width, $fallbacks);

&.mdc-switch--disabled {
Expand Down
Loading