Skip to content

Commit b9c7b27

Browse files
committed
fix(material/slide-toggle): allow touch target size to be customized
Adds a token that allows for the slide toggle touch target to be customized. (cherry picked from commit fe865b1)
1 parent 1d7ea68 commit b9c7b27

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/material/slide-toggle/_m2-slide-toggle.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
slide-toggle-visible-track-opacity: 1,
6161
slide-toggle-visible-track-transition: transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1),
6262
slide-toggle-with-icon-handle-size: 20px,
63+
slide-toggle-touch-target-size: 48px,
6364
),
6465
color: map.merge(private-get-color-palette-color-tokens($theme, primary), (
6566
slide-toggle-disabled-label-text-color:

src/material/slide-toggle/_m3-slide-toggle.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
slide-toggle-with-icon-handle-size: 24px,
6161
slide-toggle-handle-width: null,
6262
slide-toggle-handle-height: null,
63+
slide-toggle-touch-target-size: 48px,
6364
),
6465
color: (
6566
slide-toggle-disabled-label-text-color: map.get($system, on-surface),

src/material/slide-toggle/slide-toggle.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ $fallbacks: m3-slide-toggle.get-tokens();
548548
position: absolute;
549549
top: 50%;
550550
left: 50%;
551-
height: 48px;
551+
height: token-utils.slot(slide-toggle-touch-target-size, $fallbacks);
552552
width: 100%;
553553
transform: translate(-50%, -50%);
554554
display: token-utils.slot(slide-toggle-touch-target-display, $fallbacks);

0 commit comments

Comments
 (0)