Support emotion as an alternative to styled-components?
See original GitHub issueWould grommet maintainers be open to supporting emotion as an alternative to styled-components?
For example, rebass supports emotion via a Babel config which replaces 'styled-components'
imports with '@emotion/styled'
.
Off the top of my head, these are the changes that would need to be made in grommet:
- Configure emotion-specific rules in grommet’s
.babelrc
so'styled-components'
imports are renamed to'@emotion/styled'
, ensurewithTheme
is imported from'emotion-theming'
, etc. - Remove styled-components from peerDependencies. Optionally use a run-time check instead to ensure a compatible version of either styled-components or emotion is installed.
- Update documentation / getting started guides to include steps for setting up with emotion.
There are probably other changes & challenges to face; would love to know what the community & maintainers think of this.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Styled-components vs. Emotion for handling CSS
In this article, we will compare styled-components and Emotion, including differences, drawbacks, and benefits.
Read more >What are some alternatives to Emotion? - StackShare
styled -components, React Router, Angular CLI, Storybook, and Ant Design are the most popular alternatives and competitors to Emotion.
Read more >React CSS in JS: emotion vs styled components
Emotion. emotion is one of the most popular css in js libraries, it allows you to pass styles to elements “className” props like...
Read more >How we migrated 541 components from Styled ... - Storybook
That said, there are some key differences. For starters, Emotion doesn't support attrs , which is useful when you want every instance of...
Read more >Getting Emotional with EmotionJS - Medium
Emotion is a CSS-in-JS alternative to styled components. It claims to have the features of styled components, but takes a more “CSS” like ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi! is
emotion
support currently on the development roadmap or still in the planning phase? Would love to see it supported in GrommetNope, i am thinking that compatibility with styled-components should be there. Supporting emotion would be a plus.