-
-
Notifications
You must be signed in to change notification settings - Fork 485
/
Copy pathStyles.js
128 lines (119 loc) · 2.4 KB
/
Styles.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import styled, { css } from "styled-components";
const btn = (light, dark) => css`
white-space: nowrap;
display: inline-block;
border-radius: 5px;
padding: 5px 15px;
font-size: 16px;
color: white;
&:visited {
color: white;
}
background-image: linear-gradient(${light}, ${dark});
border: 1px solid ${dark};
&:hover {
background-image: linear-gradient(${light}, ${dark});
&[disabled] {
background-image: linear-gradient(${light}, ${dark});
}
}
&:visited {
color: black;
}
&[disabled] {
opacity: 0.6;
cursor: not-allowed;
}
`;
const btnDefault = css`
${btn("#ffffff", "#d5d5d5")} color: #555;
`;
const btnPrimary = btn("#4f93ce", "#285f8f");
export default styled.div`
font-family: sans-serif;
h1,
h2 {
text-align: center;
color: #222;
}
& > div {
text-align: center;
}
a {
display: block;
text-align: center;
color: #222;
}
form {
position: relative;
max-width: 500px;
margin: 10px auto;
border: 1px solid #ccc;
padding: 20px;
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
border-radius: 3px;
& > div {
position: relative;
display: flex;
flex-flow: row nowrap;
line-height: 2em;
margin: 5px;
& > label {
color: #333;
width: 110px;
font-size: 1em;
line-height: 32px;
}
& > input,
& > select,
& > textarea {
flex: 1;
padding: 3px 5px;
font-size: 1em;
margin-left: 15px;
border: 1px solid #ccc;
border-radius: 3px;
}
& > input[type="checkbox"] {
margin-top: 7px;
}
& > span {
line-height: 32px;
margin-left: 10px;
color: #800;
font-weight: bold;
}
& > div {
margin-left: 16px;
& > label {
display: block;
& > input {
margin-right: 3px;
}
}
}
}
& > .buttons {
display: flex;
flex-flow: row nowrap;
justify-content: center;
margin-top: 15px;
}
button {
margin: 0 10px;
&[type="submit"] {
${btnPrimary};
}
&[type="button"] {
${btnDefault};
}
}
pre {
position: relative;
border: 1px solid #ccc;
background: rgba(0, 0, 0, 0.1);
box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.2);
padding: 20px;
}
}
`;