Load React + Emotion from CDN URLs, use globals
Remove @emotion/babel-preset-css-prop and import { jsx } from @emotion/core directly instead so Rollup can preserve imports order when bundling (instead of @emotion/core automatically inserting itself as the first import).
This commit is contained in:
48
public/@emotion/core@10.0.6/README.md
Normal file
48
public/@emotion/core@10.0.6/README.md
Normal file
@ -0,0 +1,48 @@
|
||||
# @emotion/core
|
||||
|
||||
> Simple styling in React.
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
yarn add @emotion/core
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```jsx
|
||||
/** @jsx jsx */
|
||||
import { jsx, css, Global, ClassNames } from '@emotion/core'
|
||||
|
||||
render(
|
||||
<div css={{ color: 'hotpink' }}>
|
||||
<div
|
||||
css={css`
|
||||
color: green;
|
||||
`}
|
||||
/>
|
||||
<Global
|
||||
styles={{
|
||||
body: {
|
||||
margin: 0,
|
||||
padding: 0
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<ClassNames>
|
||||
{({ css, cx }) => (
|
||||
<div
|
||||
className={cx(
|
||||
'some-class',
|
||||
css`
|
||||
color: yellow;
|
||||
`
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
</ClassNames>
|
||||
</div>
|
||||
)
|
||||
```
|
||||
|
||||
More documentation is available at https://emotion.sh.
|
Reference in New Issue
Block a user