Skip to content

Commit bba5b4c

Browse files
more doc fixes
1 parent 6a4225e commit bba5b4c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

docs/configurable-imports.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ a prop other than `css` for processing.
3232
}
3333
```
3434

35+
Beware that if you use the babel configuration, you must import as the
36+
same name. In the previous example, we would have to `import { css as
37+
cows } from 'emotion';` then use `cows` to construct the template
38+
literals.
3539

3640
# Use Case
3741

@@ -40,7 +44,7 @@ styled-jsx application. When compiling the following file with emotion
4044
and styled-jsx.
4145

4246
```js
43-
import styled from "react-emotion";
47+
import styled, { css } from "react-emotion";
4448

4549
export default () => (
4650
<div>
@@ -61,8 +65,7 @@ outputs.
6165

6266
```js
6367
import _JSXStyle from "styled-jsx/style";
64-
import { css as _css } from "emotion";
65-
import styled from "react-emotion";
68+
import styled, { css } from "react-emotion";
6669

6770
export default (() => <div data-jsx={2648947580}>
6871
<p data-jsx={2648947580}>only this paragraph will get the style :)</p>
@@ -88,15 +91,17 @@ By adding the babel opt config rename as such.
8891
}
8992
```
9093

91-
We can avoid re-compiling the `css` props from styled-jsx.
94+
We can avoid re-compiling the `css` props and instead use `cows` for
95+
our template literals, etc.
9296

9397
```js
9498
import _JSXStyle from "styled-jsx/style";
95-
import styled, { css } from "react-emotion";
99+
import styled, { css as cows } from "react-emotion";
96100

97101
export default (() => <div data-jsx={2648947580}>
98102
<p data-jsx={2648947580}>only this paragraph will get the style :)</p>
99103
{}
100104
<_JSXStyle styleId={2648947580} css={"p[data-jsx=\"2648947580\"]{color:red}"} />
101105
</div>);
102106
```
107+

0 commit comments

Comments
 (0)