You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35
Original file line number
Diff line number
Diff line change
@@ -9,3 +9,38 @@
9
9
</img>
10
10
</a>
11
11
12
+
## Example usage:
13
+
14
+
```purescript
15
+
import React.Basic.DOM as R
16
+
import React.Basic.Hooks as React
17
+
import React.Basic.Emotion as E
18
+
19
+
myUnstyledDiv :: JSX
20
+
myUnstyledDiv = React.element R.div'
21
+
{ children: [ R.text "I have no style :(" ]
22
+
}
23
+
24
+
myStyledDiv :: JSX
25
+
myStyledDiv = E.element R.div'
26
+
{ className: "stylish-div"
27
+
, css: E.css
28
+
{ color: E.str "rebeccapurple"
29
+
, padding: E.px 4
30
+
}
31
+
}
32
+
```
33
+
34
+
Note that you need to use the apostrophised variants of react components from `React.Basic.DOM` since these represent the raw `ReactComponent`s that `Emotion` expects to work with.
35
+
36
+
## Going beyond what `style` can give you
37
+
38
+
Emotion allows you to define real CSS rules rather than only inline styles.
39
+
Here's an example of something you can't do with inline styles:
0 commit comments