Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emotion: Adding support for css prop without the need for jsx pragma … #172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ngomezc
Copy link

@ngomezc ngomezc commented Jul 31, 2019

Current Issue
Currently, you have to use the code block below in any React component that uses to wish the CSS Prop for Emotion (rather than via styled method).

Currently:

/** @jsx jsx */
import { jsx } from '@emotion/core'

See https://emotion.sh/docs/css-prop for more details.

Emotion prescribes using the "@emotion/babel-preset-css-prop" babel preset in order to avoid this. However, this does not currently work with Typescript as discussed on the following issue (or as seen by simpling trying to implement it).

emotion-js/emotion#1046

Proposed Changes
The proposed changes use the solution described here in order to support the use of the css prop without the need for the pragma statement. This only affects the packages used and the webpack presets/plugins used slightly. All functionality is intact.

Motivation
I think it's important to support both Emotion methodologies (CSS Prop and Styled Components) and doing so without the boiletplate currently needed in order to use the former.

@tzarger
Copy link

tzarger commented Sep 22, 2019

@nickgofly This seems to break Antd (Ant Design) ... have you used Antd with this repo and your update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants