@@ -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
4044and styled-jsx.
4145
4246``` js
43- import styled from " react-emotion" ;
47+ import styled , { css } from " react-emotion" ;
4448
4549export default () => (
4650 < div>
@@ -61,8 +65,7 @@ outputs.
6165
6266``` js
6367import _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
6770export 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
9498import _JSXStyle from " styled-jsx/style" ;
95- import styled , { css } from " react-emotion" ;
99+ import styled , { css as cows } from " react-emotion" ;
96100
97101export 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