-
-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathinput.tsx
86 lines (74 loc) · 1.65 KB
/
input.tsx
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
79
80
81
82
83
84
85
86
import { css, Global } from '@emotion/react'
import styled from '@emotion/styled'
import { PureComponent } from 'react'
import ReactDOM from 'react-dom'
const stylesInCallback = (props: any) =>
css({
color: 'red',
background: 'yellow',
width: `${props.scale * 100}px`,
})
const styles = css({
color: 'red',
width: '20px',
})
const styles2 = css`
color: red;
width: 20px;
`
const DivContainer = styled.div({
background: 'red',
})
const DivContainer2 = styled.div`
background: red;
`
const ContainerWithOptions = styled('div', {
shouldForwardProp: (propertyName: string) => !propertyName.startsWith('$'),
})`
color: hotpink;
`
const SpanContainer = styled('span')({
background: 'yellow',
})
export const DivContainerExtended = styled(DivContainer)``
export const DivContainerExtended2 = styled(DivContainer)({})
const Container = styled('button')`
background: red;
${stylesInCallback}
${() =>
css({
background: 'red',
})}
color: yellow;
font-size: 12px;
`
const Container2 = styled.div`
background: red;
`
export class SimpleComponent extends PureComponent {
render() {
return (
<Container
css={css`
color: hotpink;
`}
>
<Global
styles={css`
html,
body {
padding: 3rem 1rem;
margin: 0;
background: papayawhip;
min-height: 100%;
font-family: Helvetica, Arial, sans-serif;
font-size: 24px;
}
`}
/>
<span>hello</span>
</Container>
)
}
}
ReactDOM.render(<SimpleComponent />, document.querySelector('#app'))