Emotion has upgraded several components to support server-side rendering as well as some other benefits. We will need to upgrade to...
@emotion/core & @emotion/styled
emotion-theming just needs a version upgrade.
As part of this it would be convenient if the jsxPragma in mdx files was updated to use emotion's jsx function. This would allow usage of the css prop in mdx files.
@issuehuntfest has funded $40.00 to this issue. See it on IssueHunt
This would allow usage of the css prop in mdx files.
THIS WOULD BE AMAZING
I wonder if there could be a way to isolate my code from docz's code so we don't have these version mis-matches in the future.
I guess that's why storybook uses iframes. I'm not hugely excited by that, but I wonder if we could accomplish something similar by either using portals or something...
Or maybe some manual ReactDOM.render to keep my tree outside of your tree?
@kentcdodds it looks like mdx-js/mdx#166 is the blocker for allowing usage of the css prop in mdx files for now.
In regards to isolating emotion, it doesn't seem like that is needed. I've now tested both emotion 10 components running in emotion 9 docz and vice versa with no issues. It seems that as long as each module pulls in its specified version of emotion, they don't conflict with each other.
When I tried upgrading emotion to 10 today I got an error in the playground components I rendered. Something about context.stylis not being defined ๐ค
Same for me which prompted this issue ๐
thanks by the job @jtmthf, I'm merging your pull request now ๐
@pedronauck has submitted a pull request. See it on IssueHunt
@pedronauck has rewarded $28.00 to @pedronauck. See it on IssueHunt
Landed on 0.12.16 โ
Hooray! Thank you ๐
I don't get if it's still possible to use the emotion 10 css prop in mdx files, particularly in Playground components.
I used to do this with emotion 9 and it worked. How to do the same with the new version?
<Playground
css={`
button:not(:first-child) {
margin-left: 10px;
}
`}
>
<Button>Click me</Button>
<Button disabled>Disabled</Button>
</Playground>
@dotlouis Did you ever find the answer?
I did not. I've moved on from the project where I was using docz so I haven't used it in a while and I'm not sure what the status is here.
@rakannimer can we help us here?
Using emotion css prop with any component in MDX files doesn't work (not only Playground).
I opened a new issue to track and work on this : #1346