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

Using Hues in html elements from defined color palette #4297

Closed
ajaysattikar opened this issue Apr 26, 2017 · 5 comments
Closed

Using Hues in html elements from defined color palette #4297

ajaysattikar opened this issue Apr 26, 2017 · 5 comments
Assignees
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix needs: discussion Further discussion with the team is needed before proceeding

Comments

@ajaysattikar
Copy link

ajaysattikar commented Apr 26, 2017

Feature request

  1. There should be way to use the hues defined in palette theme.
  2. Provision to add color into html element from material design swatches (similar to md-color of previous version of angular material).

What is the expected behavior?

$app-primary: mat-palette($mat-grey, 500, 50, 900);
In html element, I should be able to use hues defined in my palette (above)
something like
color="primary mat-hue-2".

What is the current behavior?

I am able just to use color="primary", there is no way of using hues from defined palette/material design swatches.

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

If we can get something similar of what angular material have:
<p md-colors="{background: 'purple-600'}>
all the material design color swatches can be used directly through "md-color" attribute.

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

Angular: 4.0.2
Material: 2.0.0-beta.3

@mmalerba mmalerba added discussion feature This issue represents a new feature or feature request rather than a bug or bug fix labels Apr 27, 2017
@mmalerba
Copy link
Contributor

@jelbourn is this a feature we want to add?

@jelbourn
Copy link
Member

For now this isn't something that we're going to support because it would balloon the theming styles by a bit. When eventually we're able to use css variables it's something we'll revisit.

@ajaysattikar
Copy link
Author

ajaysattikar commented May 1, 2017

Make sense.
@jelbourn I'm just confuse on having multiple hues in theme (e.g. 500, 50, 900)
$app-primary: mat-palette($mat-grey, 500, 50, 900);
What's these exactly defined for?

@willshowell
Copy link
Contributor

@ajaysattikar in some places (possibly just progress bars - see #4088), they are used as the lighter and darker hues for components. Otherwise, you can consume those colors while theming your own components:

@import 'my-theme-partial'

$primary: map-get($theme, primary);

.light-bg {
  background-color: mat-color($primary, lighter);
}
.dark-bg {
  background-color: mat-color($primary, darker);
}

@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
@mmalerba mmalerba added the needs: discussion Further discussion with the team is needed before proceeding label Mar 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix needs: discussion Further discussion with the team is needed before proceeding
Projects
None yet
Development

No branches or pull requests

4 participants