Skip to content
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

Slide-toggle #1204

Closed
kgiroux opened this issue Sep 8, 2016 · 3 comments
Closed

Slide-toggle #1204

kgiroux opened this issue Sep 8, 2016 · 3 comments

Comments

@kgiroux
Copy link

kgiroux commented Sep 8, 2016

request:

Hi everyone, i dont understand how can i use Slide-toggle

<md-slide-toggle [color]="myColor">
Dynamic Color

I would like to use #309DB5 color, but nothing change. It is style purple.

How can i use it ...

What is the expected behavior?

Slide-toggle

What is the current behavior?

Slide-toggle

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

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

Angular 2-RC6
Material Alpha 8

Is there anything else we should know?

@devversion
Copy link
Member

devversion commented Sep 8, 2016

Right now Material 2 does not support different Material Design Palettes (See #123).

At the moment the theme is fixed for all components to

  • Teal : Primary Palette
  • Purple: Accent Palette
  • Red: Warn Palette

The slide-toggle uses by default the accent palette as per specs.

To be able to switch the different palettes, you could use the following syntax

<md-slide-toggle color="primary">

<!-- Dynamic with Angular host bindings -->
<md-slide-toggle [color]="myColor">

Also this is documented in the Readme of the slide-toggle

For your custom color, you should be able to overwrite it as long as your component stylesheet disables view encapsulation.

@jelbourn
Copy link
Member

jelbourn commented Sep 9, 2016

See #123

@jelbourn jelbourn closed this as completed Sep 9, 2016
@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

3 participants