question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support emotion as an alternative to styled-components?

See original GitHub issue

Would 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', ensure withTheme 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:open
  • Created 5 years ago
  • Reactions:5
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

9reactions
perichcommented, Sep 16, 2019

Hi! is emotion support currently on the development roadmap or still in the planning phase? Would love to see it supported in Grommet

6reactions
oorestisimecommented, Jul 28, 2019

Nope, i am thinking that compatibility with styled-components should be there. Supporting emotion would be a plus.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found