Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

fix: Button icon part color #102

Merged
merged 1 commit into from
Aug 21, 2018
Merged

fix: Button icon part color #102

merged 1 commit into from
Aug 21, 2018

Conversation

levithomason
Copy link
Member

@levithomason levithomason commented Aug 16, 2018

This PR fixes the icon color inside of Buttons.

@codecov
Copy link

codecov bot commented Aug 17, 2018

Codecov Report

Merging #102 into master will increase coverage by 0.62%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #102      +/-   ##
==========================================
+ Coverage   87.51%   88.13%   +0.62%     
==========================================
  Files          43       43              
  Lines         729      725       -4     
  Branches       98       96       -2     
==========================================
+ Hits          638      639       +1     
+ Misses         88       83       -5     
  Partials        3        3
Impacted Files Coverage Δ
src/components/Button/Button.tsx 93.93% <100%> (+12.85%) ⬆️

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 ec459f1...628cd19. Read the comment docs.

@@ -105,7 +105,7 @@ class Button extends UIComponent<any, any> {
key="btn-icon"
name={icon}
xSpacing={!content ? 'none' : iconIsAfterButton ? 'before' : 'after'}
color={primary ? 'white' : 'black'}
variables={{ color: primary ? 'white' : 'black' }}
Copy link
Contributor

@kuzhelov kuzhelov Aug 17, 2018

Choose a reason for hiding this comment

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

actually, this still will result in Icon having color different from the button's one (obviously, Icon here could be either black or white) - while, as a consumer, I would rather expect that it would take foreground color of Button

Copy link
Contributor

@kuzhelov kuzhelov left a comment

Choose a reason for hiding this comment

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

as we've agreed upon, will share cases that I asee will be problematic in case

  • of using props instead of variables, with the limited set of values and much limited set of things available for tweaks. To be clear - limit amount of customization options is absolutely necessary if we would like components to look consistent, but this move to props will eliminate some customization mechanisms that I see being critical
  • introduce cases where 'inherit' fallback won't be an option - there are quite a few of them

@levithomason
Copy link
Member Author

This PR touched a few concepts in fixing the color. I have updated it to only fix the issue with passing the correct Icon variable.

Broader changes concerning our props vs variables API can be hashed out and handled separately.

@levithomason
Copy link
Member Author

All tests now pass. @kuzhelov, merging since I've reverted the changes you've objected to.

@levithomason levithomason merged commit e9988b4 into master Aug 21, 2018
@levithomason levithomason deleted the fix/button-icon-color branch August 21, 2018 00:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants