This repository was archived by the owner on Mar 4, 2020. It is now read-only.
fix(styles): expand css shorthands in order for them to be applied properly#869
Merged
fix(styles): expand css shorthands in order for them to be applied properly#869
Conversation
added 2 commits
February 8, 2019 17:08
Codecov Report
@@ Coverage Diff @@
## master #869 +/- ##
==========================================
+ Coverage 72% 72.07% +0.07%
==========================================
Files 734 735 +1
Lines 5608 5626 +18
Branches 1640 1624 -16
==========================================
+ Hits 4038 4055 +17
- Misses 1565 1566 +1
Partials 5 5
Continue to review full report at Codecov.
|
# Conflicts: # CHANGELOG.md
bmdalex
approved these changes
Feb 21, 2019
Collaborator
bmdalex
left a comment
There was a problem hiding this comment.
yuppieee 👍 few comments but looks good
added 2 commits
February 26, 2019 18:24
# Conflicts: # CHANGELOG.md # package.json # yarn.lock
Collaborator
Changed dependencies in
Generated by 🚫 dangerJS |
-added test
kuzhelov
reviewed
Apr 9, 2019
kuzhelov
reviewed
Apr 9, 2019
kuzhelov
reviewed
Apr 9, 2019
Member
layershifter
left a comment
There was a problem hiding this comment.
As this PR introduces a new plugin for Fela I suggest to measure performance before merge 📝
added 8 commits
April 10, 2019 15:24
-refactorings
# Conflicts: # CHANGELOG.md # packages/react/package.json # yarn.lock
# Conflicts: # CHANGELOG.md
layershifter
approved these changes
Apr 11, 2019
Member
layershifter
left a comment
There was a problem hiding this comment.
We spent some time to make it more performant, so now it's quite fast 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Picks changes from #296 Fixes #237 Please see additional conversation on this PR #296
Fix
This PR aims to fix #237 by expanding the css shorthands of the theme's components styles and the styles prop provided to the component while they are merged.
I added the css-shorthand-expand library and provided service for expanding the styles. There are still some points that should be addressed:
1. The library provides extending for the following shorthands:
This means that we still don't have any mechanism for expanding the other shorthands like:
2. It would have been nice if we would be able to measure the performance of the components and conclude whether this changes would impact them.
I need input whether this is worth exploring further, or whether maybe we should just try to use the library when defining the styles for the themes or applying the styles prop on the components.
Examples which are fixed with this
The example is simple, but the
margin: '0px'can be provided based on some condition, so in some cases it would make sense.The expected result is that the
margin: '0px'will override the marginBottom. This PR insures that.marginRight,marginLeftetc. If the user specify in thestylesof this component (or in some nestedProvider), that they wantmargin: 0pxthis should override the above specifiedmarginRight | Left.In the next example we have the
Iconcomponent, that by default has right margin of8px. Using this should override that margin.The prove that this didn't work before is shown in the screener changes for the icon used inside the radio item component. Basically the
radioItemGroupStylesis overriding the right margin of the icon with the styles for the icon's slot in the following manner:margin: '0 10px 0 0', but this style was never applied, and we were not even aware that the right margin was not overriden.