-
Notifications
You must be signed in to change notification settings - Fork 60
/
main.js
78 lines (64 loc) · 1.13 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import styled, { css } from 'astroturf';
import React from 'react';
import Widget from 'widget';
import Button, { styles as btnStyles } from './Button';
import * as Buttons from './Button';
const width = 75;
const styles = css`
.parent {
color: red;
}
.test > ${btnStyles.cool}, .test > ${Widget} {
holla: yo;
}
`;
const FancyBox = styled('div')`
composes: foo from global;
color: red;
width: ${width}px;
&.primary {
background: white;
color: palevioletred;
}
`;
const FancierBox = styled('div')`
color: ultra-red;
> ${FancyBox} {
padding: 4em;
}
${styles.parent} > & {
margin: 2em;
}
/* these are the same selector */
& > ${Button} {
margin-left: 4px;
}
& > ${Buttons.Button} {
margin-left: 8px;
}
`;
export function MyComponent() {
return (
<>
<div
foo
css={css`
color: red;
&.foo {
color: blue;
}
`}
>
<div>hey </div>
<span
css={`
color: blue;
`}
>
yo
</span>
</div>
</>
);
}
export default FancierBox;