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.

Having @emotion/styled in my deps breaks all styling

See original GitHub issue

Bug report

Describe the bug

If I have @emotion/styled in my dependencies - even if I don’t import it, I chakra-ui components have no stylings. Precisely, every styled-system props is kept as-is and ends-up in the css - and is obviously invalid.

To reproduce

start a project with the latest chakra-ui (tested with rc 5, 6 and 8) and latest @emotion-styled (10.0.27). Tested with CRA 4 and latest 3.x

Expected behavior

I should be able to use @emotion/styled in my project alongside chakra-ui

Screenshots

see https://github.com/chakra-ui/chakra-ui/discussions/2409

System information

  • OS: ubuntu
  • Browser (if applies):Chrome
  • Version of @chakra-ui/core: rc 5, 6 and 8
  • Version of Node.js: 12 something

Additional context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:34 (16 by maintainers)

github_iconTop GitHub Comments

6reactions
olupcommented, Nov 5, 2020

I feel this issue is going slightly off-topic. Chakra-ui is a very customizable ui-kit based on emotion and styled-system. It’s not a styling library. If at any given time the use of Chakra is preventing user from using emotion or emotion-styled, this is an issue and should be fixed. A user should be able to use whatever css-in-js solution he wants to use, from Radium to Stitches or Styled-components, alongside chakra-ui. I’d rather have emotion as peer-dep with a hard version number if needed, or the compatible version clearly stated in the doc maybe ?

@ljosberinn on a side note, Table would be pretty neat !

4reactions
JonMontgocommented, Nov 5, 2020

Here’s a code pen I made with an example of this bug https://codesandbox.io/s/homepage-forked-5l6hj

Read more comments on GitHub >

github_iconTop Results From Across the Web

Styled Components
styled is a way to create React components that have styles attached to them. ... this allows you to change the styles of...
Read more >
Why We're Breaking Up with CSS-in-JS
While I have not measured this, I believe one of the most significant factors in how Emotion performs is whether style serialization is...
Read more >
Module not found: Error: Can't resolve '@emotion/styled ...
This is an issue caused by the break name change of emotion 11. So far storybook internally is still looking for the v10...
Read more >
FAQs
styled -components v5 does not introduce any breaking public API changes, and adds the following: Total rewrite of the core stylesheet engine, ...
Read more >
@emotion/styled | Yarn - Package Manager
Emotion 10 is a big change that we're really excited about with improvements to the css prop, a Global component for dynamic global...
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