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

Fix "color" property of <Icon> #2217

Merged
merged 3 commits into from
Mar 13, 2018
Merged

Fix "color" property of <Icon> #2217

merged 3 commits into from
Mar 13, 2018

Conversation

micooz
Copy link
Contributor

@micooz micooz commented Mar 9, 2018

Checklist

  • CircleCI
  • Include tests
  • Update documentation

Issues before change:

color is not handled in <Icon> because:

/**
* Color of icon. Equivalent to setting CSS `fill` property.
*/
color?: string;
/**

public render() {
const { className, icon, iconSize = Icon.SIZE_STANDARD, intent, title = icon, ...svgProps } = this.props;
if (icon == null) {
return null;
} else if (typeof icon !== "string") {

Changes proposed in this pull request:

This PR fixed a issue that color property doesn't work on <Icon>:

<Icon icon="add" color="red"/> // icon is now "red".

Reviewers should focus on:

If user also pass a style to the component, final style should includes user defined properties:

<Icon icon="add" color="red" style={{ color: "blue", border: "1px solid green" }}/> // icon is "red" with a green border.

Screenshot

20180309111015

@palantirtech
Copy link
Member

Thanks for your interest in palantir/blueprint, @micooz! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

Copy link
Contributor

@adidahiya adidahiya left a comment

Choose a reason for hiding this comment

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

I made a small code style adjustment. LGTM!

Your CI did pass but it's not being reported for some reason:
image

@giladgray giladgray merged commit e92fe96 into palantir:develop Mar 13, 2018
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.

4 participants