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.
Styled + ThemeProvider
A bunch of updates for this one! Firstly,
withStyled
is renamed tostyled
to follow the conventions established by other CSS-in-JS solutions.A breaking update would be the reversal of the curried functions to create a Fancy component.
It was…
It is now
This approach is more intuitive, and again, it's a standard established by other libraries.
Lastly, and more importantly, this update provides the ability to do global theming and CSS scoping.
Theming
Fancy comes with
Theme.Provider
. Added to the top-level of your app, it can modify fancy styled components via a specialprops.theme
prop.Define your theme props to
Theme.Provider
astheme
.Example
Scoping
Theme.Provider
has another specialscope
prop that allows you to define additional selectors to scope your fancystyled
component CSS under.Example
If the hashed CSS classes for
StyledCard
was.Card__213jdhx
, they will now render ashtml #App .Card__213jdhx
.