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

fix(Icon): revert changes with different roots #1435

Merged
merged 6 commits into from
May 31, 2019

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented May 31, 2019

Fixes #1407.

Reverts changes with multiple roots from #1337 (svgRoot & fontRoot). This idea breaks ability to override styles via styles prop on Icon component: svgRoot & fontRoot had more priority on merge. Also we used Box component there, it's redundant.

We definitely will want to separate these styles somehow to avoid conditions, but svgRoot/fontRoot is definitely bad stuff.

@codecov
Copy link

codecov bot commented May 31, 2019

Codecov Report

Merging #1435 into master will decrease coverage by 0.06%.
The diff coverage is 14.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1435      +/-   ##
==========================================
- Coverage   73.59%   73.53%   -0.07%     
==========================================
  Files         787      787              
  Lines        5890     5894       +4     
  Branches     1738     1722      -16     
==========================================
- Hits         4335     4334       -1     
- Misses       1549     1554       +5     
  Partials        6        6
Impacted Files Coverage Δ
...eact/src/themes/base/components/Icon/iconStyles.ts 17.39% <0%> (ø) ⬆️
...act/src/themes/teams/components/Icon/iconStyles.ts 14.7% <0%> (-0.45%) ⬇️
.../themes/font-awesome/components/Icon/iconStyles.ts 16.66% <0%> (-33.34%) ⬇️
packages/react/src/components/Icon/Icon.tsx 100% <100%> (ø) ⬆️

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 f7f0f4e...e1fabb2. Read the comment docs.

@kuzhelov kuzhelov changed the title fix(Icon): revert changes with different roots [DO NOT REVIEW] fix(Icon): revert changes with different roots May 31, 2019
@layershifter layershifter marked this pull request as ready for review May 31, 2019 11:03
@layershifter layershifter changed the title [DO NOT REVIEW] fix(Icon): revert changes with different roots fix(Icon): revert changes with different roots May 31, 2019
@layershifter layershifter added 🧰 fix Introduces fix for broken behavior. 🚀 ready for review labels May 31, 2019
@@ -3,7 +3,7 @@ import { IconProps } from '../../../../components/Icon/Icon'
import { IconVariables } from '../../../teams/components/Icon/iconVariables'

const iconStyles: ComponentSlotStylesInput<IconProps, IconVariables> = {
fontRoot: (): ICSSInJSStyle => ({
root: (): ICSSInJSStyle => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Shuold we add this conditionally if the icon is font icon? Won't this break icons on docs?

Copy link
Contributor

Choose a reason for hiding this comment

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

I check that it doesn't break anything, so not sure if you should implement the comment...

Copy link
Contributor

Choose a reason for hiding this comment

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

agree that it is better to introduce explicit condition check here, as we are expecting this rule to be applied exclusively to font-based icons

Copy link
Collaborator

@bmdalex bmdalex left a comment

Choose a reason for hiding this comment

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

👍

@layershifter layershifter merged commit e077ecf into master May 31, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix/revert-icon-roots branch May 31, 2019 16:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🧰 fix Introduces fix for broken behavior. 🚀 ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Icon backgroundColor not working
4 participants