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

Warn about css prop/babel plugin compatibility earlier #1712

Merged
merged 2 commits into from
Jul 2, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions docs/css-prop.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Use the [JSX Pragma](#jsx-pragma) method instead.
"presets": ["@emotion/babel-preset-css-prop"]
}
```

Compatibility Note: If you include the plugin `babel-plugin-transform-react-inline-elements` in your `.babelrc` your styles will not be applied. The plugin is not compatible with the `css` prop.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so sure about the change - it obviously doesn't hurt anybody, but I'm wondering if it's the best place for such information. @mitchellhamilton wdyt?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've decided not to include it here as it's already mentioned on the bottom - but I've added a new warning about this to the @emotion/babel-preset-css-prop's README

> [Full `@emotion/babel-preset-css-prop` documentation](https://emotion.sh/docs/@emotion/babel-preset-css-prop)

#### JSX Pragma
Expand Down Expand Up @@ -244,7 +244,3 @@ The styles are concatenated together and inserted via `insertRule`.
```

Relying on the css spec's ["Order of Appearance"](https://www.w3.org/TR/css-cascade-3/#cascade-order) rule, property values defined later (green) override those before it (red).

## Gotchas

- If you include the plugin `babel-plugin-transform-react-inline-elements` in your `.babelrc` your styles will not be applied. The plugin is not compatible with the `css` prop.