Skip to content

Commit ac555fa

Browse files
committed
feat(material/slider): add customizable thumb dimensions for m2 and m3
Fixes #31101
1 parent afa9e1e commit ac555fa

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/material/slider/_m2-slider.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
slider-handle-height: 20px,
1414
slider-handle-shape: 50%,
1515
slider-handle-width: 20px,
16+
slider-thumb-height: 48px,
17+
slider-thumb-width: 48px,
1618
slider-inactive-track-height: 4px,
1719
slider-inactive-track-shape: 9999px,
1820
slider-value-indicator-border-radius: 4px,

src/material/slider/_m3-slider.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
slider-active-track-height: 4px,
2525
slider-handle-height: 20px,
2626
slider-handle-width: 20px,
27+
slider-thumb-height: 48px,
28+
slider-thumb-width: 48px,
2729
slider-inactive-track-height: 4px,
2830
slider-with-overlap-handle-outline-width: 1px,
2931
slider-with-tick-marks-active-container-opacity: 0.38,

src/material/slider/slider.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ $fallbacks: m3-slider.get-tokens();
175175
left: -24px;
176176
outline: none;
177177
position: absolute;
178-
height: 48px;
179-
width: 48px;
178+
height: token-utils.slot(slider-thumb-height, $fallbacks);
179+
width: token-utils.slot(slider-thumb-width, $fallbacks);
180180
pointer-events: none;
181181

182182
.mdc-slider--discrete & {
@@ -299,7 +299,7 @@ $fallbacks: m3-slider.get-tokens();
299299
outline: none;
300300
vertical-align: middle;
301301
cursor: pointer;
302-
height: 48px;
302+
height: token-utils.slot(slider-thumb-height, $fallbacks);
303303
margin: 0 $mat-slider-horizontal-margin;
304304
position: relative;
305305
touch-action: pan-y;

0 commit comments

Comments
 (0)