-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
63 lines (56 loc) · 1.37 KB
/
App.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
import React from "react";
import styled, { css } from "simple-css-in-js";
import { color } from "styled-system";
const Button = styled.button`
background-color: yellow;
padding: 10px 20px;
${color}
`;
const primaryColor = "white";
const secondaryColor = "green";
const padding = "10px 20px";
const bgColor = "black";
const AnotherButton = styled.button`
background-color: ${secondaryColor};
padding: ${padding};
color: ${primaryColor};
`;
const Input = styled.input`
padding: 10px 20px;
background-color: ${props => (props.primary ? "gray" : "palevioletred")};
color: white;
`;
const AnotherInput = styled(Input)`
background-color: yellow;
color: green;
`;
const divCls = css`
background-color: ${bgColor};
width: 50px;
height: 50px;
color: white;
`;
export default function App(props) {
return (
<div>
<div>A div that need to be styled</div>
<Button color="red" disabled>
This is styled button
</Button>
<AnotherButton disabled>This is another styled button</AnotherButton>
<Input type="text" primary />
<AnotherInput placeholder="Another input" />
<div className={divCls}>Content</div>
<div
className={css`
background-color: ${props.bgColor};
width: 50px;
height: 50px;
color: white;
`}
>
Content
</div>
</div>
);
}