-
Notifications
You must be signed in to change notification settings - Fork 26
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(icons): make icons themeable (breaking change) #726
Conversation
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.
LGTM! 💯
PS: there are some weird inconsistencies in percy...or did we break something?
src/components/field-label/README.md
Outdated
@@ -39,7 +39,7 @@ The `hintIcon` also accepts a custom `theme` while defaulting to `orange` in the | |||
onInfoButtonClick={() => {}} />} | |||
hint={<FormattedMessage {...messages.hint} />} | |||
- hintIcon={<WarningIcon />} | |||
+ hintIcon={<WarningIcon theme="green" />} | |||
+ hintIcon={<WarningIcon color="green" />} |
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.
+ hintIcon={<WarningIcon color="green" />} | |
+ hintIcon={<WarningIcon color="primary" />} |
src/components/icons/README.md
Outdated
| Props | Type | Required | Values | Default | Description | | ||
| ------- | -------- | :------: | ------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------ | | ||
| `size` | `string` | | 'small', 'medium', 'big', 'scale' | 'big' | Specifies the icon size (if `scale` is selected, the dimensions will scale according with the parents) | | ||
| `color` | `string` | | 'solid', 'neutral60', 'info', 'primary40', 'warning', 'error' | 'solid' | Specifies the icon 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.
| `color` | `string` | | 'solid', 'neutral60', 'info', 'primary40', 'warning', 'error' | 'solid' | Specifies the icon color | | |
| `color` | `string` | | 'solid', 'neutral60', 'info', 'primary', 'primary40', 'warning', 'error' | 'solid' | Specifies the icon color | |
case 'warning': | ||
return overwrittenVars.colorWarning; | ||
case 'error': | ||
return overwrittenVars.colorError; |
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.
Wondering if this could be more of a convention approach instead of switching?
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.
Still valid?
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.
can you check the latest version?
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.
Wondering if we should have this to a base branch of release/x.x.x
if we want more accumulate more breaking changes.
if (isDisabled) return 'grey'; | ||
if (tone === 'urgent') return 'white'; | ||
return 'black'; | ||
const getArrowColor = ({ tone, isDisabled }) => { |
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.
Good rename!
I think the Percy diff it's a combination of breaking things and of the icon VRTs (7 I think) have different labels so therefore have a diff. But yeah, must be some broken things. I'll fix up the broken things tomorrow 😄 |
@tdeekens I think that a v10 branch is a really good idea 👍 |
Ah Percy doesn't run if I have it aimed against a different branch. I guess that makes sense. |
...theme, | ||
}; | ||
|
||
const iconColor = overwrittenVars[`color${capitalize(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.
is this more like what you were thinking @tdeekens ?
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.
Ah yeah. Thanks!
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.
it's funny because the old values were more color
than the new ones 😅
} | ||
return 'white'; | ||
return 'surface'; | ||
} | ||
|
||
// if button is disabled, icon should be grey |
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 update the comments too ?
Okay, I'll merge this into |
* feat(icons): make icons themeable (breaking change)
* feat(icons): make icons themeable (breaking change)
* feat(icons): make icons themeable (breaking change)
* feat(icons): make icons themeable (breaking change)
* feat(icons): make icons themeable (breaking change)
* feat(icons): make icons themeable (breaking change)
* feat(icons): make icons themeable (breaking change)
* feat(icons): make icons themeable (breaking change)
* feat(icons): make icons themeable (breaking change)
* feat(icons): make icons themeable (breaking change)
* feat(icons): make icons themeable (breaking change)
* feat(icons): make icons themeable (breaking change)
* feat(icons): make icons themeable (breaking change)
* feat(icons): make icons themeable (breaking change)
* feat(icons): make icons themeable (breaking change)
* feat(icons): make icons themeable (breaking change)
Summary
As we discussed on slack, in order to make the icons themeable, we need to do something about the
theme
prop. When you use a styled component in emotion, it injects itstheme
prop, which we were overwriting since we had an identically named prop.💣 BREAKING CHANGES 💣
theme
tocolor
. Renames it's possible values from being our old colour decisions (white, green, etc) to our new colour decisions (surface, primary, etc).Why do we need themeable icons?
Components that use icons, like for example, the
TimeInput
need this to maintain consistency.Why are you spelling colour wrong?
😭
This will be merged into the
10.0.0
branch. The PR is set to master now so that Percy runs.