Skip to content

Commit a31f6ee

Browse files
committed
fix(material/radio): allow touch target size to be customized
Adds a token that allows for the radio button touch target to be customized.
1 parent febe2c6 commit a31f6ee

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/material/radio/_m2-radio.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// determines the size of the radio button itself and there are internal
1616
// tests who don't configure the theme correctly.
1717
radio-state-layer-size: 40px,
18+
radio-touch-target-size: 48px,
1819
),
1920
color: private-get-color-palette-color-tokens($theme, secondary),
2021
typography: (

src/material/radio/_m3-radio.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
base: (
1717
radio-disabled-unselected-icon-opacity: 0.38,
1818
radio-disabled-selected-icon-opacity: 0.38,
19+
radio-touch-target-size: 48px,
1920
),
2021
color: (
2122
radio-checked-ripple-color: map.get($system, primary),

src/material/radio/radio.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ $fallbacks: m3-radio.get-tokens();
8888
position: absolute;
8989
top: 50%;
9090
left: 50%;
91-
height: 48px;
92-
width: 48px;
91+
height: token-utils.slot(radio-touch-target-size, $fallbacks);
92+
width: token-utils.slot(radio-touch-target-size, $fallbacks);
9393
transform: translate(-50%, -50%);
9494
display: token-utils.slot(radio-touch-target-display, $fallbacks);
9595

0 commit comments

Comments
 (0)