Skip to content

Slide-toggle theme color does not follow app theme definition, but is fixed at 500 level default #13044

Closed
@MichaelScottBurke

Description

@MichaelScottBurke

Bug:

slide toggle does not match app theme definition when base is set (to a value other than the default 500 'level')

What is the expected behavior?

That Slide-toggle @input() color: ThemePalette matches app theme definition when base is defined so that slide-toggle will match other themed components

What is the current behavior?

Slide toggle is fixed at the 500 level for each theme color: e.g., primary, accent and warn.

What are the steps to reproduce?

  1. ) set app theme to values other than default; e.g.,
@import '~@angular/material/theming';
@include mat-core();

$primary: mat-palette($mat-teal, 700, 300, 900);
$accent: mat-palette($mat-blue, 900, 300, 900);
$warn: mat-palette($mat-red, 900, 300, 800);

$my-theme: mat-light-theme($primary, $accent, $warn);
@include angular-material-theme($my-theme);
  1. Compare Switch (slide-toggle) to other theme-able components

screen shot 2018-09-08 at 9 26 04 am

  1. Inspect hex value; e.g.,: version with 'accent' (mat-blue palette) theme color applied:
    button: #0d47a1 = 700 (accent, base from mat-blue-palette)
    chip: #0d47a1 = 700
    slide toggle: #2196f3 = 500

What is the use-case or motivation for changing an existing behavior?

The switch does not match my other themed components, it is lighter

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 6+, Angular Material 6+, mac os, all browsers

Is there anything else we should know?

issues seems to be in setting the thumb-checked-hue to 'default' in light theme in the slide-toggle theme

...
$thumb-checked-hue: if($is-dark, 200, default);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions