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

fix(Icon): color and borderColor should inherit the color, or be changed via the variables #569

Merged
merged 10 commits into from
Dec 6, 2018

Conversation

mnajdova
Copy link
Contributor

@mnajdova mnajdova commented Dec 6, 2018

This PR fixes #506 following the instructions in the #506 (comment)
Here are the rules that are applied:

  1. If no variables are provided for the color and borderColor, both are inherited
  2. If the color variable is provided, then both the color of the icon as well as the border are respecting that value
  3. If the borderColor variable is provided then the color of the border is respecting this value

In addition to this, the example for the color of the icon is updated, so that we can catch any regression for the behaviors of the colors. It looks like this now:
image

@mnajdova mnajdova changed the title fix(Icon): color and borderColor should inherit the color, or be changes via the variables fix(Icon): color and borderColor should inherit the color, or be changed via the variables Dec 6, 2018
<Icon name="home" variables={{ color: 'red' }} />
<Icon name="home" variables={{ color: 'orange' }} />
{/* The colors for the icon and the border are inherited. */}
<div style={{ color: 'violet', padding: '1rem', display: 'inline-block' }}>
Copy link
Member

Choose a reason for hiding this comment

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

May be we can use our Grid component to avoid styling (display, padding)?

  <Grid columns='repeat(4, auto)'>
    <div />
    <div />
    // others
  </Grid>

Copy link
Member

@layershifter layershifter Dec 6, 2018

Choose a reason for hiding this comment

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

We can also split this to 4 four examples and may be this will better option. For example, https://react.semantic-ui.com/collections/menu/#types-pointing

This section has two examples and we can do the same. This will allow to have description in the title instead of code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, it makes sense to have four different examples. Will refactor this. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We decided offline, that we will use the Grid with description for each of the examples, as introducing another sections will introduce unnecessary additional scrolling on the page.

@@ -11,7 +11,7 @@ const Variations = () => (
/>
<ComponentExample
title="Color"
description="An icon can have a different color"
description="An icon is inheriting the color, but can have a different color if provided by the user."
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

... is inheriting color by default, ...

@@ -17,6 +17,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Unreleased]

### Fixes
- The border color of the Icon is inherited if no value is provided for the `color` and `borderColor` variables @mnajdova ([#569](https://github.com/stardust-ui/react/pull/569))
Copy link
Contributor

Choose a reason for hiding this comment

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

please, ensure that this entry will be in a proper section of CHANGELOG.md after merging the recent master

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.

👍 please, just address the layout issue @layershifter has mentioned before merging

@mnajdova mnajdova merged commit 9f46f25 into master Dec 6, 2018
</span>
}
weight="bold"
/>
Copy link
Member

Choose a reason for hiding this comment

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

In the future, try to minimize the number of lines of code in doc site examples:

    <Text
      content={
        <span>
          USING THE <code>color</code> VARIABLE:
        </span>
      }
      weight="bold"
    />
<Text weight="bold">USING THE <code>color</code> VARIABLE:</Text>

@layershifter layershifter deleted the fix/icon-color-inherited branch December 8, 2018 13:09
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.

Icon does not respect 'error' property, but Text does
4 participants