Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

feat(colors): directive to use any color from any palette everywhere #7791

Closed
wants to merge 1 commit into from

Conversation

EladBezalel
Copy link
Member

  • added directive and documentation
  • added tests
  • added smart watch option, when the directive recognize at least one of it's values needs interpolation it starts to watching it

fixes #1269

@EladBezalel EladBezalel added the in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs label Mar 29, 2016
restrict: 'A',
link: function (scope, elem, attrs) {
scope.$watch(attrs.mdColors, function (val) {
Object.keys(val).forEach(function (key) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could spare calling Object.keys and iterating it by using angular.forEach(val, function(value, key){ ... });

@EladBezalel EladBezalel force-pushed the feat/md-colors branch 3 times, most recently from 79a2490 to dffb9e7 Compare March 30, 2016 22:59
@ErinCoughlan
Copy link
Contributor

@gmoothart Is anything missing here that we could have used for tabs?

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

1 similar comment
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

@googlebot
Copy link

CLAs look good, thanks!

1 similar comment
@googlebot
Copy link

CLAs look good, thanks!

@ThomasBurleson
Copy link
Contributor

@EladBezalel - The demo needs some text to describe the demo, the intent, and the power of mdColors.
Please explain why this is needed in addition to- Themes.

@ThomasBurleson
Copy link
Contributor

In a right-aligned column (in the color boxe), please show the hex color values. e.g. #2196F3.

screen shot 2016-04-03 at 6 00 27 pm

@ThomasBurleson
Copy link
Contributor

Please refactor the colors.spec.js to reduce the non-DRY code.

@topherfangio
Copy link
Contributor

@EladBezalel If we introduce this API, I can see developers wanting to use it in many places/components. Can you test the following components to make sure that it is compatible:

  • Toast (particularly, can you easily change the background color)
  • Icon
  • Divider
  • Subheader
  • and Tooltip

If it doesn't work out of the box, we may need to update some of the components to make this easier.

@ThomasBurleson
Copy link
Contributor

@EladBezalel - see refactored colors.spec.js

@EladBezalel
Copy link
Member Author

  • Toast (particularly, can you easily change the background color)
  • Icon
  • Divider
  • Subheader
  • Tooltip

toast and tooltip have elements containing the styles

@EladBezalel EladBezalel force-pushed the feat/md-colors branch 2 times, most recently from 5526d74 to 87b6704 Compare April 9, 2016 15:51
ThomasBurleson pushed a commit that referenced this pull request Apr 12, 2016
… on any element

- directive and documentation
- service and documentation
- tests
- smart watch option, when the directive recognize at least one of it's values needs interpolation it starts to watch it
- mdColorsWatch - when set to false the directive doesn't watch for changes

- $mdColorUtil - aggregate color related utils
- fixed theming scoping issue - THEME was defined globally which made it leak and changed for other modules

fixes #1269

Closes #7791
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

1 similar comment
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.


// Text Colors on light and dakr backgrounds
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dark

@googlebot
Copy link

CLAs look good, thanks!

1 similar comment
@googlebot
Copy link

CLAs look good, thanks!

… on any element

- directive and documentation
- service and documentation
- tests
- smart watch option, when the directive recognize at least one of it's values needs interpolation it starts to watch it
- mdColorsWatch - when set to false the directive doesn't watch for changes
- when using `background` property the directive will seamlessly set the foreground color according the palette hue

- $mdColorUtil - aggregate color related utils
- fixed theming scoping issue - THEME was defined globally which made it leak and changed for other modules

fixes #1269
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

colors and hues should be available everywhere.
7 participants