-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.css
263 lines (223 loc) · 6.18 KB
/
index.css
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
/* Figma file: https://www.figma.com/file/twasy8Bca4hW7gunLFSLoY/Color-Scheme-Generator */
* {
box-sizing: border-box;
}
:root {
--color-bg: #fff;
--color-bg-button: #fff;
--color-border-button: #D1D5DB;
--color-border-select: #D1D5DB;
--color-font-color: #2B283A;
--color-icon-select: #9CA3AF;
--color-bg-copy-button: #1F2937;
--color-bg-scheme-button-hover: #1F2937;
}
body {
background-color: #222;
font-family: 'Inter', sans-serif;
font-size: 0.75rem;
font-weight: 400;
position: relative;
}
button {
padding: 0 11px;
font-weight: 500;
border: 0;
cursor: pointer;
}
label {
position: absolute;
left: -1000px;
}
.generator {
max-width: 96%;
width: 550px;
min-height: 550px;
margin: 2em auto 0;
background-color: var(--color-bg);
}
.generator__header {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 1em 0;
padding: 25px 15px;
box-shadow: 0px 4px 11px rgba(0, 0, 0, 0.15);
}
.generator__colorpicker {
height: 42px;
}
.generator__palette {
display: flex;
flex-direction: column;
height: calc(100% - 92px);
}
.generator__button {
background-color: var(--color-bg-button);
border: 1px solid var(--color-border-button);
border-radius: 4px;
height: 42px;
width: 100%;
}
.generator__button:hover,
.generator__button:focus {
background-color: var(--color-bg-scheme-button-hover);
color: #fff;
}
.generator__colorblock {
display: grid;
grid-template-rows: 2fr 1fr;
flex: 1 0 auto;
}
.generator__colorblock:hover {
cursor: pointer;
}
.generator__colorblock:hover .generator__copy {
opacity: 1;
}
.generator__color {
background-color: var(--color-bg);
}
.generator__colorcode {
position: relative;
display: flex;
align-items: center;
justify-content: center;
padding: 0.8em;
}
.generator__copy {
content: "Copy";
position: absolute;
top: 0;
right: 0;
background-color: var(--color-bg-copy-button);
color: white;
font-size: 0.625rem;
padding: 0.25em 0.5em;
text-transform: uppercase;
opacity: 0;
transition: 0.4s opacity;
}
#status {
opacity: 0;
visibility: hidden;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 1;
background-color: var(--color-bg-copy-button);
color: var(--color-bg);
padding: 1rem 2rem;
border-radius: 6px;
text-align: center;
transition: opacity 0.4s ease-in-out;
font-size: 12px;
font-weight: 500;
border: 3px solid transparent;
}
#status.active {
opacity: 1;
visibility: visible;
}
#credits {
color: #fff;
font-size: 0.875rem;
text-align: center;
margin-top: 32px;
}
#credits a {
color: #ACEF21;
}
#credits a:hover,
#credits a:focus {
color: #6F9E0D;
}
#credits a:visited {
color: #E94EFA;
}
/* Select CSS code */
.select-css {
display: block;
font-size: 1rem;
height: 42px;
padding: 0 13px;
width: 100%;
max-width: 100%;
/* useful when width is set to anything other than 100% */
box-sizing: border-box;
margin: 0;
border: 1px solid var(--color-border-select);
box-shadow: 0 1px 0 1px rgba(0, 0, 0, .04);
border-radius: 6px;
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
background-color: var(--color-bg);
/* note: bg image below uses 2 urls. The first is an svg data uri for the arrow icon, and the second is the gradient.
for the icon, if you want to change the color, be sure to use `%23` instead of `#`, since it's a url. You can also swap in a different svg icon or an external image reference
*/
background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
background-repeat: no-repeat, repeat;
/* arrow icon position (1em from the right, 50% vertical) , then gradient position*/
background-position: right .7em top 50%, 0 0;
/* icon size, then gradient */
background-size: .65em auto, 100%;
}
/* Hide arrow icon in IE browsers */
.select-css::-ms-expand {
display: none;
}
/* Hover style */
.select-css:hover {
border-color: var(--color-font-color);
}
/* Focus style */
.select-css:focus {
border-color: var(--color-border-select);
/* It'd be nice to use -webkit-focus-ring-color here but it doesn't work on box-shadow */
box-shadow: 0 0 1px 3px rgba(59, 153, 252, .7);
box-shadow: 0 0 0 3px -moz-mac-focusring;
color: var(--color-font-color);
outline: none;
}
/* Set options to normal weight */
.select-css option {
font-weight: normal;
}
/* Support for rtl text, explicit support for Arabic and Hebrew */
*[dir="rtl"] .select-css,
:root:lang(ar) .select-css,
:root:lang(iw) .select-css {
background-position: left .7em top 50%, 0 0;
padding: .6em .8em .5em 1.4em;
}
/* Disabled styles */
.select-css:disabled,
.select-css[aria-disabled=true] {
color: graytext;
background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22graytext%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'),
linear-gradient(to bottom, var(--color-bg) 0%, #e5e5e5 100%);
}
.select-css:disabled:hover,
.select-css[aria-disabled=true] {
border-color: var(--color-border-select);
}
@media (min-width: 480px) {
.generator {
height: 550px;
}
.generator__header {
flex-wrap: nowrap;
}
.generator__button {
width: auto;
}
.generator__palette {
flex-direction: row;
}
.generator__colorblock {
grid-template-rows: 5fr 1fr;
}
}