-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
Codecov Report
@@ 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.
|
There was a problem hiding this 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?
demos/button.html
Outdated
<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 |
There was a problem hiding this comment.
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.
demos/button.html
Outdated
<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> |
There was a problem hiding this comment.
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?
demos/button.html
Outdated
@@ -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 |
There was a problem hiding this comment.
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?)
packages/mdc-button/README.md
Outdated
`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. |
There was a problem hiding this comment.
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."
demos/button.scss
Outdated
|
||
.demo-text-color { | ||
@include mdc-button-icon-color(white); | ||
@include mdc-button-ink-color(orange); |
There was a problem hiding this comment.
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?)
There was a problem hiding this 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
demos/button.html
Outdated
@@ -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> |
There was a problem hiding this comment.
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
demos/button.html
Outdated
@@ -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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
72d3035
to
1c52ac8
Compare
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.