Skip to content

Commit 2d8f56e

Browse files
committed
fix(material/checkbox): allow touch target size to be customized
Adds a token that allows for the checkbox touch target to be customized. (cherry picked from commit febe2c6)
1 parent 3f20001 commit 2d8f56e

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/material/checkbox/_m2-checkbox.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
checkbox-unselected-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
1818
checkbox-unselected-pressed-state-layer-opacity:
1919
map.get($system, pressed-state-layer-opacity),
20+
checkbox-touch-target-size: 48px,
2021
),
2122
color: private-get-color-palette-color-tokens($theme, secondary),
2223
typography: (

src/material/checkbox/_m3-checkbox.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
checkbox-unselected-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
2121
checkbox-unselected-pressed-state-layer-opacity:
2222
map.get($system, pressed-state-layer-opacity),
23+
checkbox-touch-target-size: 48px,
2324
),
2425
color: (
2526
checkbox-disabled-label-color: m3-utils.color-with-opacity(map.get($system, on-surface), 38%),

src/material/checkbox/checkbox.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ $fallbacks: m3-checkbox.get-tokens();
8585
position: absolute;
8686
top: 50%;
8787
left: 50%;
88-
height: 48px;
89-
width: 48px;
88+
height: token-utils.slot(checkbox-touch-target-size, $fallbacks);
89+
width: token-utils.slot(checkbox-touch-target-size, $fallbacks);
9090
transform: translate(-50%, -50%);
9191
display: token-utils.slot(checkbox-touch-target-display, $fallbacks);
9292
}

0 commit comments

Comments
 (0)