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

feat(button): Add ability to color icons separately from the text #2362

Merged
merged 9 commits into from
Mar 19, 2018

Conversation

williamernest
Copy link
Contributor

Fixes: #2335
I added the mdc-button-icon-color mixin. The other mixin wasn't needed, since the icons use the text colors by default.

@codecov-io
Copy link

codecov-io commented Mar 8, 2018

Codecov Report

Merging #2362 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2362   +/-   ##
=======================================
  Coverage   98.86%   98.86%           
=======================================
  Files         101      101           
  Lines        4151     4151           
  Branches      531      531           
=======================================
  Hits         4104     4104           
  Misses         47       47

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 04b9ea0...d5b65df. Read the comment docs.

Copy link
Contributor

@kfranqueiro kfranqueiro left a comment

Choose a reason for hiding this comment

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

The new mixin needs to be added to the README, right?

<div>
<button class="mdc-button mdc-button--unelevated demo-text-color" data-demo-no-js>
<i class="material-icons mdc-button__icon">favorite</i>
Big Corner Radius
Copy link
Contributor

Choose a reason for hiding this comment

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

Update the labels on these buttons; these labels were copied from the previous two examples but don't make sense here.

<fieldset>
<legend class="mdc-typography--title">Different Color Icons/Text</legend>
<div>
<button class="mdc-button mdc-button--unelevated demo-text-color" data-demo-no-js>
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we include a demo for JS-upgraded buttons too?

@@ -312,11 +312,11 @@ <h1 class="mdc-typography--display2">CSS Only</h1>
<div>
<button class="mdc-button mdc-button--unelevated demo-text-color" data-demo-no-js>
<i class="material-icons mdc-button__icon">favorite</i>
Big Corner Radius
Text Color
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Ink Color to match mixin name and since it's really changing both? (Maybe update the classname also?)

`mdc-button-stroke-width` | Sets the stroke width to the given number (defaults to 2px)
`mdc-button-container-fill-color` | Sets the container color to the given color.
`mdc-button-icon-color` | Sets the icon color to the given color.
`mdc-button-ink-color` | Sets the ink color to the given color.
Copy link
Contributor

Choose a reason for hiding this comment

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

Might want to add that "This affects both text and icon, unless mdc-button-icon-color is also used."


.demo-text-color {
@include mdc-button-icon-color(white);
@include mdc-button-ink-color(orange);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also be applying mdc-states(orange) here? (I'm assuming that should still prioritize matching text over matching icon? Maybe we should ask design, if text/icon can be different colors, which color the "ink" and therefore the ripple is?)

Copy link
Contributor

@kfranqueiro kfranqueiro left a comment

Choose a reason for hiding this comment

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

Realized 2 other places to s/text/ink/, otherwise LGTM

@@ -234,6 +234,20 @@ <h1 class="mdc-typography--display2">Ripple Enabled</h1>
</div>
</fieldset>

<fieldset>
<legend class="mdc-typography--title">Different Color Icons/Text</legend>
Copy link
Contributor

Choose a reason for hiding this comment

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

Also replace Text w/ Ink here

@@ -363,6 +377,20 @@ <h1 class="mdc-typography--display2">CSS Only</h1>
</button>
</div>
</fieldset>

<fieldset>
<legend class="mdc-typography--title">Different Color Icons/Text</legend>
Copy link
Contributor

Choose a reason for hiding this comment

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

and here

@williamernest williamernest force-pushed the feat/button/color-text-icon-separately branch from 72d3035 to 1c52ac8 Compare March 19, 2018 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants