Skip to content

multiple theme - mdslider not apply theme #4075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
deblockt opened this issue Apr 13, 2017 · 2 comments
Closed

multiple theme - mdslider not apply theme #4075

deblockt opened this issue Apr 13, 2017 · 2 comments

Comments

@deblockt
Copy link

deblockt commented Apr 13, 2017

Bug, feature request, or proposal:

bug

What is the expected behavior?

mdSlider need use theme specified by class

What is the current behavior?

mdSlider use default theme

What are the steps to reproduce?

Create a multiple theme

// Define the default theme (same as the example above).
$candy-app-primary: mat-palette($mat-indigo);
$candy-app-accent:  mat-palette($mat-pink, A200, A100, A400);
$candy-app-theme:   mat-light-theme($candy-app-primary, $candy-app-accent);
@include angular-material-theme($candy-app-theme);

// second theme
$theme2-primary: mat-palette($mat-red);
$theme2-accent:  mat-palette($mat-green, A200, A100, A400);
$theme2-warn:    mat-palette($mat-deep-orange);
$theme2-theme:   mat-light-theme($theme2-primary, $theme2-accent, $theme2-warn);

.theme2 {
    @include angular-material-theme($theme2theme);
}

Use mdSlider like this :

<div [class.theme2]="theme2">
         <button (click)="theme2 = !theme2">switch</button>
         <md-slider color="primary" thumbLabel ></md-slider>
</div>

Providing a Plunker (or similar) is the best way to get the team to see your issue.
Plunker template: https://goo.gl/DlHd6U

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

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

Angular : 4.0.1
Material : 2.0.0-beta.3

Is there anything else we should know?

Same behaviour on input placeholer.

I'have temporary fix the issue whith this mixin :

@mixin fix-angular-material-theme($theme) {
    @include angular-material-theme($theme);
    $primary: map-get($theme, primary);

    // slider color fix
    .mat-primary .mat-slider-track-fill, .mat-primary .mat-slider-thumb, .mat-primary .mat-slider-thumb-label {
        background-color: mat-color($primary) !important;
    }
}
@jelbourn
Copy link
Member

Dupe of #4077

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants