Skip to content

Commit 7d96ed3

Browse files
devversionvivian-hu-zz
authored andcommittedJan 16, 2019
fix(slide-toggle): use default hue for thumb in dark theme (#14230)
* The thumb should use the `default` hue in dark themes to match the MDC behavior and also make it easier for people to create a custom theme without needing to explicitly specify the `200` hue just for the slide-toggle. This also makes the slide-toggle more consistent with the checkbox and radio (which are considered selection controls as well) Fixes #14192
1 parent 651549f commit 7d96ed3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎src/lib/slide-toggle/_slide-toggle-theme.scss

+5-3
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@
3333

3434
// Color hues are based on the specs which briefly show the hues that are applied to a switch.
3535
// The 2018 specs no longer describe how dark switches should look like. Due to the lack of
36-
// information for dark themed switches, we keep the old behavior that is based on the previous
37-
// specifications. See: https://material.io/design/components/selection-controls.html#specs
36+
// information for dark themed switches, we partially keep the old behavior that is based on
37+
// the previous specifications. For the checked color we always use the `default` hue because
38+
// that follows MDC and also makes it easier for people to create a custom theme without needing
39+
// to specify each hue individually.
3840
$thumb-unchecked-hue: if($is-dark, 400, 50);
39-
$thumb-checked-hue: if($is-dark, 200, default);
41+
$thumb-checked-hue: default;
4042

4143
$bar-unchecked-color: mat-color($foreground, disabled);
4244
$ripple-unchecked-color: mat-color($foreground, base);

0 commit comments

Comments
 (0)
Please sign in to comment.