This repository has been archived by the owner on Dec 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(css): improve built-in support with css prop as function (#181)
* chore: refactor getGlamorClassName * fix(css): improve built-in support with css prop as function **What**: This refactors things a bit and separates `css` the prop from the overrides props. **Why**: Otherwise, if the `css` prop happens to be a function, the `propsAreCssOverrides` would make the props be assigned to the function and then they'd never actually be applied. By splitting them from each other it allows us to merge both of them. **How**: Most of the work happened in `get-glamor-classname.js`. I first refactored it to simplify things a bit. Then I plugged in the `cssProp` and `cssOverrides` into their order of precidence. I also added a bit of recursion to the `handleStyles` function which allows you to pass an array of functions, this is useful for the `css` prop in particular. So you can compose functions together without a `compose` helper.
- Loading branch information
Kent C. Dodds
authored
Jun 15, 2017
1 parent
f48ed27
commit 41119c8
Showing
6 changed files
with
55 additions
and
40 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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