Skip to content

Commit 7828bd9

Browse files
committed
fix(material-experimental/mdc-slider): dedup mdc-slider styles (#22195)
* remove mdc-slider theme from theme.scss since it is already included in all-theme now * avoid using deprecated mdc-theme prop-value function in _slider-theme.scss
1 parent 655b474 commit 7828bd9

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/dev-app/theme.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ $candy-app-theme: theming.light-theme((
4343
@include all-theme.angular-material-mdc-theme($candy-app-theme);
4444
@include column-resize.theme($candy-app-theme);
4545
@include popover-edit.theme($candy-app-theme);
46-
// We add this in manually for now, because it isn't included in `angular-material-mdc-theme`.
47-
@include slider-theme.theme($candy-app-theme);
4846

4947
.demo-strong-focus {
5048
// Include base styles for strong focus indicators.

src/material-experimental/mdc-slider/_slider-theme.scss

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
@use 'sass:map';
2+
13
@use '@material/slider/slider' as mdc-slider;
24
@use '@material/slider/slider-theme';
35
@use '@material/theme/variables' as theme-variables;
6+
@use '@material/theme/theme' as mdc-theme;
47
@use '../mdc-helpers/mdc-helpers';
58
@use '../../material/core/ripple/ripple';
69
@use '../../material/core/theming/theming';
@@ -107,15 +110,16 @@
107110
),
108111
$query: mdc-helpers.$mat-theme-styles-query
109112
);
110-
@include ripple.theme((
113+
$ripple-color: map.get(theme-variables.$property-values, $color);
114+
@include ripple.color((
111115
foreground: (
112-
base: theme-variables.prop-value($color)
116+
base: $ripple-color
113117
),
114118
));
115119
.mat-mdc-slider-hover-ripple {
116-
background-color: rgba(theme-variables.prop-value($color), 0.05);
120+
background-color: rgba($ripple-color, 0.05);
117121
}
118122
.mat-mdc-slider-focus-ripple, .mat-mdc-slider-active-ripple {
119-
background-color: rgba(theme-variables.prop-value($color), 0.2);
123+
background-color: rgba($ripple-color, 0.2);
120124
}
121125
}

0 commit comments

Comments
 (0)