pickit-color 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +44 -0
- package/README.md +170 -0
- package/dist/colorpicker.css +881 -0
- package/dist/colorpicker.js +929 -0
- package/dist/colorpicker.min.css +1 -0
- package/dist/colorpicker.min.js +2 -0
- package/dist/esm/index.js +820 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/index.d.ts +79 -0
- package/package.json +69 -0
- package/src/README.md +292 -0
- package/src/colorpicker.d.ts +52 -0
- package/src/colorpicker.styl +719 -0
- package/src/index.ts +1181 -0
|
@@ -0,0 +1,881 @@
|
|
|
1
|
+
/* Pickit ColorPicker Styles */
|
|
2
|
+
/* Variables */
|
|
3
|
+
/* Screen reader only */
|
|
4
|
+
.colorpicker-sr-only {
|
|
5
|
+
position: absolute;
|
|
6
|
+
width: 1px;
|
|
7
|
+
height: 1px;
|
|
8
|
+
padding: 0;
|
|
9
|
+
margin: -1px;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
clip: rect(0, 0, 0, 0);
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
border-width: 0;
|
|
14
|
+
}
|
|
15
|
+
/* Container */
|
|
16
|
+
.colorpicker-container {
|
|
17
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
18
|
+
background: #fff;
|
|
19
|
+
border: 1px solid #e5e7eb;
|
|
20
|
+
border-radius: 8px;
|
|
21
|
+
-webkit-box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
22
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
23
|
+
padding: 16px;
|
|
24
|
+
width: 280px;
|
|
25
|
+
-webkit-user-select: none;
|
|
26
|
+
-moz-user-select: none;
|
|
27
|
+
-ms-user-select: none;
|
|
28
|
+
user-select: none;
|
|
29
|
+
}
|
|
30
|
+
.colorpicker-container:focus-within {
|
|
31
|
+
outline: 2px solid #3b82f6;
|
|
32
|
+
outline-offset: 2px;
|
|
33
|
+
}
|
|
34
|
+
.colorpicker-container.colorpicker-inline {
|
|
35
|
+
width: 100%;
|
|
36
|
+
max-width: 100%;
|
|
37
|
+
-webkit-box-shadow: none;
|
|
38
|
+
box-shadow: none;
|
|
39
|
+
}
|
|
40
|
+
.colorpicker-container.colorpicker-inline .colorpicker-saturation {
|
|
41
|
+
height: 200px;
|
|
42
|
+
}
|
|
43
|
+
.colorpicker-container.colorpicker-presets-only {
|
|
44
|
+
width: auto;
|
|
45
|
+
min-width: 200px;
|
|
46
|
+
max-width: 400px;
|
|
47
|
+
}
|
|
48
|
+
.colorpicker-container.colorpicker-presets-only .colorpicker-presets {
|
|
49
|
+
margin: 0;
|
|
50
|
+
padding: 0;
|
|
51
|
+
}
|
|
52
|
+
.colorpicker-container.colorpicker-presets-only.colorpicker-inline {
|
|
53
|
+
max-width: 100%;
|
|
54
|
+
}
|
|
55
|
+
/* Content */
|
|
56
|
+
.colorpicker-content {
|
|
57
|
+
display: -webkit-box;
|
|
58
|
+
display: -ms-flexbox;
|
|
59
|
+
display: flex;
|
|
60
|
+
-webkit-box-orient: vertical;
|
|
61
|
+
-webkit-box-direction: normal;
|
|
62
|
+
-ms-flex-direction: column;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
gap: 16px;
|
|
65
|
+
}
|
|
66
|
+
/* Saturation/Lightness Box */
|
|
67
|
+
.colorpicker-saturation {
|
|
68
|
+
position: relative;
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: 180px;
|
|
71
|
+
background: -webkit-gradient(linear, left bottom, left top, from(#000), to(transparent)), -webkit-gradient(linear, left top, right top, from(#fff), to(transparent));
|
|
72
|
+
background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent);
|
|
73
|
+
border-radius: 6px;
|
|
74
|
+
cursor: crosshair;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
}
|
|
77
|
+
.colorpicker-saturation:focus {
|
|
78
|
+
outline: 2px solid #3b82f6;
|
|
79
|
+
outline-offset: 2px;
|
|
80
|
+
}
|
|
81
|
+
.colorpicker-saturation:focus:not(:focus-visible) {
|
|
82
|
+
outline: none;
|
|
83
|
+
}
|
|
84
|
+
.colorpicker-saturation-overlay {
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: 0;
|
|
87
|
+
left: 0;
|
|
88
|
+
right: 0;
|
|
89
|
+
bottom: 0;
|
|
90
|
+
pointer-events: none;
|
|
91
|
+
}
|
|
92
|
+
.colorpicker-saturation-pointer {
|
|
93
|
+
position: absolute;
|
|
94
|
+
width: 20px;
|
|
95
|
+
height: 20px;
|
|
96
|
+
border: 3px solid #fff;
|
|
97
|
+
border-radius: 50%;
|
|
98
|
+
-webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(0,0,0,0.1);
|
|
99
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(0,0,0,0.1);
|
|
100
|
+
-webkit-transform: translate(-50%, -50%);
|
|
101
|
+
transform: translate(-50%, -50%);
|
|
102
|
+
pointer-events: none;
|
|
103
|
+
-webkit-transition: -webkit-transform 0.1s ease;
|
|
104
|
+
transition: -webkit-transform 0.1s ease;
|
|
105
|
+
transition: transform 0.1s ease;
|
|
106
|
+
transition: transform 0.1s ease, -webkit-transform 0.1s ease;
|
|
107
|
+
}
|
|
108
|
+
@media (prefers-reduced-motion: reduce) {
|
|
109
|
+
.colorpicker-saturation-pointer {
|
|
110
|
+
-webkit-transition: none;
|
|
111
|
+
transition: none;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/* Controls Section */
|
|
115
|
+
.colorpicker-controls {
|
|
116
|
+
display: -webkit-box;
|
|
117
|
+
display: -ms-flexbox;
|
|
118
|
+
display: flex;
|
|
119
|
+
gap: 12px;
|
|
120
|
+
-webkit-box-align: stretch;
|
|
121
|
+
-ms-flex-align: stretch;
|
|
122
|
+
align-items: stretch;
|
|
123
|
+
}
|
|
124
|
+
.colorpicker-sliders {
|
|
125
|
+
-webkit-box-flex: 1;
|
|
126
|
+
-ms-flex: 1;
|
|
127
|
+
flex: 1;
|
|
128
|
+
display: -webkit-box;
|
|
129
|
+
display: -ms-flexbox;
|
|
130
|
+
display: flex;
|
|
131
|
+
-webkit-box-orient: vertical;
|
|
132
|
+
-webkit-box-direction: normal;
|
|
133
|
+
-ms-flex-direction: column;
|
|
134
|
+
flex-direction: column;
|
|
135
|
+
gap: 12px;
|
|
136
|
+
}
|
|
137
|
+
.colorpicker-slider-group {
|
|
138
|
+
display: -webkit-box;
|
|
139
|
+
display: -ms-flexbox;
|
|
140
|
+
display: flex;
|
|
141
|
+
-webkit-box-orient: vertical;
|
|
142
|
+
-webkit-box-direction: normal;
|
|
143
|
+
-ms-flex-direction: column;
|
|
144
|
+
flex-direction: column;
|
|
145
|
+
gap: 4px;
|
|
146
|
+
}
|
|
147
|
+
.colorpicker-label {
|
|
148
|
+
font-size: 12px;
|
|
149
|
+
font-weight: 500;
|
|
150
|
+
color: #6b7280;
|
|
151
|
+
text-transform: uppercase;
|
|
152
|
+
letter-spacing: 0.5px;
|
|
153
|
+
}
|
|
154
|
+
/* Range Sliders */
|
|
155
|
+
.colorpicker-slider {
|
|
156
|
+
-webkit-appearance: none;
|
|
157
|
+
-moz-appearance: none;
|
|
158
|
+
appearance: none;
|
|
159
|
+
width: 100%;
|
|
160
|
+
height: 8px;
|
|
161
|
+
border-radius: 4px;
|
|
162
|
+
outline: none;
|
|
163
|
+
cursor: pointer;
|
|
164
|
+
}
|
|
165
|
+
.colorpicker-slider:focus {
|
|
166
|
+
-webkit-box-shadow: 0 0 0 2px #3b82f6;
|
|
167
|
+
box-shadow: 0 0 0 2px #3b82f6;
|
|
168
|
+
}
|
|
169
|
+
.colorpicker-slider::-webkit-slider-thumb {
|
|
170
|
+
-webkit-appearance: none;
|
|
171
|
+
appearance: none;
|
|
172
|
+
width: 18px;
|
|
173
|
+
height: 18px;
|
|
174
|
+
border-radius: 50%;
|
|
175
|
+
background: #fff;
|
|
176
|
+
border: 2px solid #3b82f6;
|
|
177
|
+
cursor: pointer;
|
|
178
|
+
-webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.2);
|
|
179
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.2);
|
|
180
|
+
-webkit-transition: -webkit-transform 0.1s ease;
|
|
181
|
+
transition: -webkit-transform 0.1s ease;
|
|
182
|
+
transition: transform 0.1s ease;
|
|
183
|
+
transition: transform 0.1s ease, -webkit-transform 0.1s ease;
|
|
184
|
+
}
|
|
185
|
+
.colorpicker-slider::-webkit-slider-thumb:hover {
|
|
186
|
+
-webkit-transform: scale(1.1);
|
|
187
|
+
transform: scale(1.1);
|
|
188
|
+
}
|
|
189
|
+
.colorpicker-slider::-webkit-slider-thumb:active {
|
|
190
|
+
-webkit-transform: scale(0.95);
|
|
191
|
+
transform: scale(0.95);
|
|
192
|
+
}
|
|
193
|
+
.colorpicker-slider::-moz-range-thumb {
|
|
194
|
+
width: 18px;
|
|
195
|
+
height: 18px;
|
|
196
|
+
border-radius: 50%;
|
|
197
|
+
background: #fff;
|
|
198
|
+
border: 2px solid #3b82f6;
|
|
199
|
+
cursor: pointer;
|
|
200
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.2);
|
|
201
|
+
-webkit-transition: -webkit-transform 0.1s ease;
|
|
202
|
+
transition: -webkit-transform 0.1s ease;
|
|
203
|
+
transition: transform 0.1s ease;
|
|
204
|
+
transition: transform 0.1s ease, -webkit-transform 0.1s ease;
|
|
205
|
+
}
|
|
206
|
+
.colorpicker-slider::-moz-range-thumb:hover {
|
|
207
|
+
transform: scale(1.1);
|
|
208
|
+
}
|
|
209
|
+
.colorpicker-slider::-moz-range-thumb:active {
|
|
210
|
+
transform: scale(0.95);
|
|
211
|
+
}
|
|
212
|
+
/* Hue Slider */
|
|
213
|
+
.colorpicker-hue-slider {
|
|
214
|
+
background: -webkit-gradient(linear, left top, right top, from(#f00), color-stop(#ff0), color-stop(#0f0), color-stop(#0ff), color-stop(#00f), color-stop(#f0f), to(#f00));
|
|
215
|
+
background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
|
|
216
|
+
}
|
|
217
|
+
/* Alpha Slider */
|
|
218
|
+
.colorpicker-alpha-slider {
|
|
219
|
+
background: linear-gradient(to right, transparent, currentColor), linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
|
|
220
|
+
background-size: 100%, 10px 10px, 10px 10px, 10px 10px, 10px 10px;
|
|
221
|
+
background-position: 0 0, 0 0, 0 5px, 5px -5px, -5px 0px;
|
|
222
|
+
}
|
|
223
|
+
/* Saturation & Lightness Sliders (backgrounds set dynamically in JS) */
|
|
224
|
+
/* Slider-only mode layout */
|
|
225
|
+
.colorpicker-sliders-only {
|
|
226
|
+
gap: 12px;
|
|
227
|
+
}
|
|
228
|
+
/* Controls Container - im Slider-Modus vertikal */
|
|
229
|
+
.colorpicker-controls {
|
|
230
|
+
display: -webkit-box;
|
|
231
|
+
display: -ms-flexbox;
|
|
232
|
+
display: flex;
|
|
233
|
+
gap: 12px;
|
|
234
|
+
}
|
|
235
|
+
.colorpicker-controls:has(.colorpicker-sliders:not(.colorpicker-sliders-only)) {
|
|
236
|
+
-webkit-box-orient: horizontal;
|
|
237
|
+
-webkit-box-direction: normal;
|
|
238
|
+
-ms-flex-direction: row;
|
|
239
|
+
flex-direction: row;
|
|
240
|
+
}
|
|
241
|
+
.colorpicker-controls:has(.colorpicker-sliders-only) {
|
|
242
|
+
-webkit-box-orient: vertical;
|
|
243
|
+
-webkit-box-direction: normal;
|
|
244
|
+
-ms-flex-direction: column;
|
|
245
|
+
flex-direction: column;
|
|
246
|
+
}
|
|
247
|
+
.colorpicker-controls:has(.colorpicker-sliders-only) .colorpicker-preview {
|
|
248
|
+
width: 100%;
|
|
249
|
+
height: 48px;
|
|
250
|
+
min-height: 48px;
|
|
251
|
+
-webkit-box-ordinal-group: 0;
|
|
252
|
+
-ms-flex-order: -1;
|
|
253
|
+
order: -1;
|
|
254
|
+
}
|
|
255
|
+
.colorpicker-controls:has(.colorpicker-sliders-only) .colorpicker-preview .colorpicker-preview-color {
|
|
256
|
+
min-height: 48px;
|
|
257
|
+
}
|
|
258
|
+
/* Preview */
|
|
259
|
+
.colorpicker-preview {
|
|
260
|
+
width: 40px;
|
|
261
|
+
min-width: 40px;
|
|
262
|
+
height: 40px;
|
|
263
|
+
min-height: 40px;
|
|
264
|
+
display: -webkit-box;
|
|
265
|
+
display: -ms-flexbox;
|
|
266
|
+
display: flex;
|
|
267
|
+
-webkit-box-align: stretch;
|
|
268
|
+
-ms-flex-align: stretch;
|
|
269
|
+
align-items: stretch;
|
|
270
|
+
-ms-flex-negative: 0;
|
|
271
|
+
flex-shrink: 0;
|
|
272
|
+
}
|
|
273
|
+
.colorpicker-preview-color {
|
|
274
|
+
-webkit-box-flex: 1;
|
|
275
|
+
-ms-flex: 1;
|
|
276
|
+
flex: 1;
|
|
277
|
+
border-radius: 6px;
|
|
278
|
+
border: 2px solid #e5e7eb;
|
|
279
|
+
-webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
|
|
280
|
+
box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
|
|
281
|
+
position: relative;
|
|
282
|
+
}
|
|
283
|
+
.colorpicker-preview-color::before {
|
|
284
|
+
content: '';
|
|
285
|
+
position: absolute;
|
|
286
|
+
top: 0;
|
|
287
|
+
left: 0;
|
|
288
|
+
right: 0;
|
|
289
|
+
bottom: 0;
|
|
290
|
+
background: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
|
|
291
|
+
background-size: 10px 10px;
|
|
292
|
+
background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
|
|
293
|
+
border-radius: 4px;
|
|
294
|
+
z-index: -1;
|
|
295
|
+
}
|
|
296
|
+
/* Input Wrapper (inside picker) */
|
|
297
|
+
.colorpicker-input-wrapper {
|
|
298
|
+
display: -webkit-box;
|
|
299
|
+
display: -ms-flexbox;
|
|
300
|
+
display: flex;
|
|
301
|
+
-webkit-box-orient: vertical;
|
|
302
|
+
-webkit-box-direction: normal;
|
|
303
|
+
-ms-flex-direction: column;
|
|
304
|
+
flex-direction: column;
|
|
305
|
+
gap: 4px;
|
|
306
|
+
}
|
|
307
|
+
.colorpicker-input-row {
|
|
308
|
+
display: -webkit-box;
|
|
309
|
+
display: -ms-flexbox;
|
|
310
|
+
display: flex;
|
|
311
|
+
gap: 8px;
|
|
312
|
+
-webkit-box-align: center;
|
|
313
|
+
-ms-flex-align: center;
|
|
314
|
+
align-items: center;
|
|
315
|
+
}
|
|
316
|
+
.colorpicker-input {
|
|
317
|
+
-webkit-box-flex: 1;
|
|
318
|
+
-ms-flex: 1;
|
|
319
|
+
flex: 1;
|
|
320
|
+
padding: 8px 12px;
|
|
321
|
+
border: 1px solid #e5e7eb;
|
|
322
|
+
border-radius: 6px;
|
|
323
|
+
font-family: 'Monaco', 'Menlo', monospace;
|
|
324
|
+
font-size: 14px;
|
|
325
|
+
color: #1f2937;
|
|
326
|
+
background: #fff;
|
|
327
|
+
-webkit-transition: border-color 0.2s ease, -webkit-box-shadow 0.2s ease;
|
|
328
|
+
transition: border-color 0.2s ease, -webkit-box-shadow 0.2s ease;
|
|
329
|
+
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
|
330
|
+
transition: border-color 0.2s ease, box-shadow 0.2s ease, -webkit-box-shadow 0.2s ease;
|
|
331
|
+
}
|
|
332
|
+
.colorpicker-input:focus {
|
|
333
|
+
outline: none;
|
|
334
|
+
border-color: #3b82f6;
|
|
335
|
+
-webkit-box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
|
|
336
|
+
box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
|
|
337
|
+
}
|
|
338
|
+
.colorpicker-input::-webkit-input-placeholder {
|
|
339
|
+
color: #9ca3af;
|
|
340
|
+
}
|
|
341
|
+
.colorpicker-input::-moz-placeholder {
|
|
342
|
+
color: #9ca3af;
|
|
343
|
+
}
|
|
344
|
+
.colorpicker-input:-ms-input-placeholder {
|
|
345
|
+
color: #9ca3af;
|
|
346
|
+
}
|
|
347
|
+
.colorpicker-input::-ms-input-placeholder {
|
|
348
|
+
color: #9ca3af;
|
|
349
|
+
}
|
|
350
|
+
.colorpicker-input::placeholder {
|
|
351
|
+
color: #9ca3af;
|
|
352
|
+
}
|
|
353
|
+
.colorpicker-eyedropper-btn {
|
|
354
|
+
display: -webkit-box;
|
|
355
|
+
display: -ms-flexbox;
|
|
356
|
+
display: flex;
|
|
357
|
+
-webkit-box-align: center;
|
|
358
|
+
-ms-flex-align: center;
|
|
359
|
+
align-items: center;
|
|
360
|
+
-webkit-box-pack: center;
|
|
361
|
+
-ms-flex-pack: center;
|
|
362
|
+
justify-content: center;
|
|
363
|
+
width: 36px;
|
|
364
|
+
height: 36px;
|
|
365
|
+
padding: 8px;
|
|
366
|
+
border: 1px solid #e5e7eb;
|
|
367
|
+
border-radius: 6px;
|
|
368
|
+
background: #fff;
|
|
369
|
+
color: #1f2937;
|
|
370
|
+
cursor: pointer;
|
|
371
|
+
-webkit-transition: all 0.2s ease;
|
|
372
|
+
transition: all 0.2s ease;
|
|
373
|
+
-ms-flex-negative: 0;
|
|
374
|
+
flex-shrink: 0;
|
|
375
|
+
}
|
|
376
|
+
.colorpicker-eyedropper-btn:hover {
|
|
377
|
+
background: #f3f4f6;
|
|
378
|
+
border-color: #3b82f6;
|
|
379
|
+
}
|
|
380
|
+
.colorpicker-eyedropper-btn:active {
|
|
381
|
+
-webkit-transform: scale(0.95);
|
|
382
|
+
transform: scale(0.95);
|
|
383
|
+
}
|
|
384
|
+
.colorpicker-eyedropper-btn:focus {
|
|
385
|
+
outline: none;
|
|
386
|
+
border-color: #3b82f6;
|
|
387
|
+
-webkit-box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
|
|
388
|
+
box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
|
|
389
|
+
}
|
|
390
|
+
.colorpicker-eyedropper-btn svg {
|
|
391
|
+
width: 20px;
|
|
392
|
+
height: 20px;
|
|
393
|
+
display: block;
|
|
394
|
+
}
|
|
395
|
+
.colorpicker-system-picker-btn {
|
|
396
|
+
display: -webkit-box;
|
|
397
|
+
display: -ms-flexbox;
|
|
398
|
+
display: flex;
|
|
399
|
+
-webkit-box-align: center;
|
|
400
|
+
-ms-flex-align: center;
|
|
401
|
+
align-items: center;
|
|
402
|
+
-webkit-box-pack: center;
|
|
403
|
+
-ms-flex-pack: center;
|
|
404
|
+
justify-content: center;
|
|
405
|
+
width: 36px;
|
|
406
|
+
height: 36px;
|
|
407
|
+
padding: 8px;
|
|
408
|
+
border: 1px solid #e5e7eb;
|
|
409
|
+
border-radius: 6px;
|
|
410
|
+
background: #fff;
|
|
411
|
+
color: #1f2937;
|
|
412
|
+
cursor: pointer;
|
|
413
|
+
-webkit-transition: all 0.2s ease;
|
|
414
|
+
transition: all 0.2s ease;
|
|
415
|
+
-ms-flex-negative: 0;
|
|
416
|
+
flex-shrink: 0;
|
|
417
|
+
}
|
|
418
|
+
.colorpicker-system-picker-btn:hover {
|
|
419
|
+
background: #f3f4f6;
|
|
420
|
+
border-color: #3b82f6;
|
|
421
|
+
}
|
|
422
|
+
.colorpicker-system-picker-btn:active {
|
|
423
|
+
-webkit-transform: scale(0.95);
|
|
424
|
+
transform: scale(0.95);
|
|
425
|
+
}
|
|
426
|
+
.colorpicker-system-picker-btn:focus {
|
|
427
|
+
outline: none;
|
|
428
|
+
border-color: #3b82f6;
|
|
429
|
+
-webkit-box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
|
|
430
|
+
box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
|
|
431
|
+
}
|
|
432
|
+
.colorpicker-system-picker-btn svg {
|
|
433
|
+
width: 20px;
|
|
434
|
+
height: 20px;
|
|
435
|
+
display: block;
|
|
436
|
+
}
|
|
437
|
+
/* Presets */
|
|
438
|
+
.colorpicker-presets {
|
|
439
|
+
display: grid;
|
|
440
|
+
grid-template-columns: repeat(8, 1fr);
|
|
441
|
+
gap: 8px;
|
|
442
|
+
padding-top: 4px;
|
|
443
|
+
}
|
|
444
|
+
.colorpicker-presets.colorpicker-presets-list {
|
|
445
|
+
grid-template-columns: 1fr;
|
|
446
|
+
gap: 6px;
|
|
447
|
+
}
|
|
448
|
+
.colorpicker-preset {
|
|
449
|
+
width: 100%;
|
|
450
|
+
aspect-ratio: 1;
|
|
451
|
+
border: 2px solid transparent;
|
|
452
|
+
border-radius: 4px;
|
|
453
|
+
cursor: pointer;
|
|
454
|
+
-webkit-transition: all 0.2s ease;
|
|
455
|
+
transition: all 0.2s ease;
|
|
456
|
+
position: relative;
|
|
457
|
+
overflow: hidden;
|
|
458
|
+
}
|
|
459
|
+
.colorpicker-preset::before {
|
|
460
|
+
content: '';
|
|
461
|
+
position: absolute;
|
|
462
|
+
top: 0;
|
|
463
|
+
left: 0;
|
|
464
|
+
right: 0;
|
|
465
|
+
bottom: 0;
|
|
466
|
+
background: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
|
|
467
|
+
background-size: 6px 6px;
|
|
468
|
+
background-position: 0 0, 0 3px, 3px -3px, -3px 0px;
|
|
469
|
+
z-index: -1;
|
|
470
|
+
}
|
|
471
|
+
.colorpicker-preset:hover {
|
|
472
|
+
-webkit-transform: scale(1.15);
|
|
473
|
+
transform: scale(1.15);
|
|
474
|
+
border-color: #3b82f6;
|
|
475
|
+
-webkit-box-shadow: 0 2px 8px rgba(0,0,0,0.15);
|
|
476
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
|
|
477
|
+
}
|
|
478
|
+
.colorpicker-preset:focus {
|
|
479
|
+
outline: none;
|
|
480
|
+
border-color: #3b82f6;
|
|
481
|
+
-webkit-box-shadow: 0 0 0 2px rgba(59,130,246,0.3);
|
|
482
|
+
box-shadow: 0 0 0 2px rgba(59,130,246,0.3);
|
|
483
|
+
}
|
|
484
|
+
.colorpicker-preset:active {
|
|
485
|
+
-webkit-transform: scale(0.95);
|
|
486
|
+
transform: scale(0.95);
|
|
487
|
+
}
|
|
488
|
+
/* List view for presets */
|
|
489
|
+
.colorpicker-preset-list-item {
|
|
490
|
+
aspect-ratio: unset;
|
|
491
|
+
display: -webkit-box;
|
|
492
|
+
display: -ms-flexbox;
|
|
493
|
+
display: flex;
|
|
494
|
+
-webkit-box-align: center;
|
|
495
|
+
-ms-flex-align: center;
|
|
496
|
+
align-items: center;
|
|
497
|
+
gap: 12px;
|
|
498
|
+
padding: 8px 12px;
|
|
499
|
+
background: #f9fafb;
|
|
500
|
+
}
|
|
501
|
+
.colorpicker-preset-list-item:hover {
|
|
502
|
+
-webkit-transform: none;
|
|
503
|
+
transform: none;
|
|
504
|
+
background: #f3f4f6;
|
|
505
|
+
}
|
|
506
|
+
.colorpicker-preset-list-item:focus {
|
|
507
|
+
background: #f3f4f6;
|
|
508
|
+
}
|
|
509
|
+
.colorpicker-preset-color {
|
|
510
|
+
width: 32px;
|
|
511
|
+
height: 32px;
|
|
512
|
+
border-radius: 6px;
|
|
513
|
+
-ms-flex-negative: 0;
|
|
514
|
+
flex-shrink: 0;
|
|
515
|
+
position: relative;
|
|
516
|
+
}
|
|
517
|
+
.colorpicker-preset-color::before {
|
|
518
|
+
content: '';
|
|
519
|
+
position: absolute;
|
|
520
|
+
top: 0;
|
|
521
|
+
left: 0;
|
|
522
|
+
right: 0;
|
|
523
|
+
bottom: 0;
|
|
524
|
+
background: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
|
|
525
|
+
background-size: 6px 6px;
|
|
526
|
+
background-position: 0 0, 0 3px, 3px -3px, -3px 0px;
|
|
527
|
+
border-radius: 6px;
|
|
528
|
+
z-index: -1;
|
|
529
|
+
}
|
|
530
|
+
.colorpicker-preset-label {
|
|
531
|
+
font-size: 14px;
|
|
532
|
+
font-weight: 500;
|
|
533
|
+
color: #1f2937;
|
|
534
|
+
text-align: left;
|
|
535
|
+
-webkit-box-flex: 1;
|
|
536
|
+
-ms-flex: 1;
|
|
537
|
+
flex: 1;
|
|
538
|
+
}
|
|
539
|
+
/* Input Group with Preview */
|
|
540
|
+
.colorpicker-input-group {
|
|
541
|
+
display: -webkit-inline-box;
|
|
542
|
+
display: -ms-inline-flexbox;
|
|
543
|
+
display: inline-flex;
|
|
544
|
+
-webkit-box-align: stretch;
|
|
545
|
+
-ms-flex-align: stretch;
|
|
546
|
+
align-items: stretch;
|
|
547
|
+
width: 100%;
|
|
548
|
+
max-width: 400px;
|
|
549
|
+
border: 2px solid #e5e7eb;
|
|
550
|
+
border-radius: 8px;
|
|
551
|
+
overflow: hidden;
|
|
552
|
+
-webkit-transition: all 0.2s ease;
|
|
553
|
+
transition: all 0.2s ease;
|
|
554
|
+
background: #fff;
|
|
555
|
+
}
|
|
556
|
+
.colorpicker-input-group:focus-within {
|
|
557
|
+
border-color: #3b82f6;
|
|
558
|
+
-webkit-box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
|
|
559
|
+
box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
|
|
560
|
+
}
|
|
561
|
+
.colorpicker-input-preview {
|
|
562
|
+
display: -webkit-box;
|
|
563
|
+
display: -ms-flexbox;
|
|
564
|
+
display: flex;
|
|
565
|
+
-webkit-box-align: center;
|
|
566
|
+
-ms-flex-align: center;
|
|
567
|
+
align-items: center;
|
|
568
|
+
-webkit-box-pack: center;
|
|
569
|
+
-ms-flex-pack: center;
|
|
570
|
+
justify-content: center;
|
|
571
|
+
width: 48px;
|
|
572
|
+
min-width: 48px;
|
|
573
|
+
border-right: 2px solid #e5e7eb;
|
|
574
|
+
position: relative;
|
|
575
|
+
cursor: pointer;
|
|
576
|
+
-webkit-transition: background-color 0.2s ease;
|
|
577
|
+
transition: background-color 0.2s ease;
|
|
578
|
+
}
|
|
579
|
+
.colorpicker-input-preview::before {
|
|
580
|
+
content: '';
|
|
581
|
+
position: absolute;
|
|
582
|
+
top: 0;
|
|
583
|
+
left: 0;
|
|
584
|
+
right: 0;
|
|
585
|
+
bottom: 0;
|
|
586
|
+
background: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
|
|
587
|
+
background-size: 8px 8px;
|
|
588
|
+
background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
|
|
589
|
+
z-index: -1;
|
|
590
|
+
}
|
|
591
|
+
input.colorpicker-has-preview {
|
|
592
|
+
border: none;
|
|
593
|
+
-webkit-box-flex: 1;
|
|
594
|
+
-ms-flex: 1;
|
|
595
|
+
flex: 1;
|
|
596
|
+
padding: 10px 14px;
|
|
597
|
+
font-size: 15px;
|
|
598
|
+
font-family: 'Monaco', 'Menlo', monospace;
|
|
599
|
+
background: transparent;
|
|
600
|
+
}
|
|
601
|
+
input.colorpicker-has-preview:focus {
|
|
602
|
+
outline: none;
|
|
603
|
+
-webkit-box-shadow: none;
|
|
604
|
+
box-shadow: none;
|
|
605
|
+
}
|
|
606
|
+
/* Compact Button */
|
|
607
|
+
.colorpicker-compact-button {
|
|
608
|
+
display: -webkit-inline-box;
|
|
609
|
+
display: -ms-inline-flexbox;
|
|
610
|
+
display: inline-flex;
|
|
611
|
+
-webkit-box-align: center;
|
|
612
|
+
-ms-flex-align: center;
|
|
613
|
+
align-items: center;
|
|
614
|
+
-webkit-box-pack: center;
|
|
615
|
+
-ms-flex-pack: center;
|
|
616
|
+
justify-content: center;
|
|
617
|
+
width: 40px;
|
|
618
|
+
height: 40px;
|
|
619
|
+
padding: 4px;
|
|
620
|
+
border: 2px solid #e5e7eb;
|
|
621
|
+
border-radius: 6px;
|
|
622
|
+
background: #fff;
|
|
623
|
+
cursor: pointer;
|
|
624
|
+
-webkit-transition: all 0.2s ease;
|
|
625
|
+
transition: all 0.2s ease;
|
|
626
|
+
vertical-align: middle;
|
|
627
|
+
}
|
|
628
|
+
.colorpicker-compact-button:hover {
|
|
629
|
+
border-color: #3b82f6;
|
|
630
|
+
-webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
631
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
632
|
+
-webkit-transform: translateY(-1px);
|
|
633
|
+
transform: translateY(-1px);
|
|
634
|
+
}
|
|
635
|
+
.colorpicker-compact-button:active {
|
|
636
|
+
-webkit-transform: translateY(0) scale(0.98);
|
|
637
|
+
transform: translateY(0) scale(0.98);
|
|
638
|
+
}
|
|
639
|
+
.colorpicker-compact-button:focus {
|
|
640
|
+
outline: none;
|
|
641
|
+
border-color: #3b82f6;
|
|
642
|
+
-webkit-box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
|
|
643
|
+
box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
|
|
644
|
+
}
|
|
645
|
+
.colorpicker-compact-button svg {
|
|
646
|
+
width: 20px;
|
|
647
|
+
height: 20px;
|
|
648
|
+
display: block;
|
|
649
|
+
color: #1f2937;
|
|
650
|
+
}
|
|
651
|
+
.colorpicker-compact-button:focus {
|
|
652
|
+
outline: none;
|
|
653
|
+
border-color: #3b82f6;
|
|
654
|
+
-webkit-box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
|
|
655
|
+
box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
|
|
656
|
+
}
|
|
657
|
+
.colorpicker-compact-button:active {
|
|
658
|
+
-webkit-transform: translateY(0);
|
|
659
|
+
transform: translateY(0);
|
|
660
|
+
}
|
|
661
|
+
@media (prefers-reduced-motion: reduce) {
|
|
662
|
+
.colorpicker-compact-button {
|
|
663
|
+
-webkit-transition: none;
|
|
664
|
+
transition: none;
|
|
665
|
+
}
|
|
666
|
+
.colorpicker-compact-button:hover {
|
|
667
|
+
-webkit-transform: none;
|
|
668
|
+
transform: none;
|
|
669
|
+
}
|
|
670
|
+
.colorpicker-compact-button:active {
|
|
671
|
+
-webkit-transform: none;
|
|
672
|
+
transform: none;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
.colorpicker-compact-preview {
|
|
676
|
+
display: block;
|
|
677
|
+
width: 100%;
|
|
678
|
+
height: 100%;
|
|
679
|
+
border-radius: 4px;
|
|
680
|
+
border: 1px solid rgba(0,0,0,0.1);
|
|
681
|
+
position: relative;
|
|
682
|
+
overflow: hidden;
|
|
683
|
+
}
|
|
684
|
+
.colorpicker-compact-preview::before {
|
|
685
|
+
content: '';
|
|
686
|
+
position: absolute;
|
|
687
|
+
top: 0;
|
|
688
|
+
left: 0;
|
|
689
|
+
right: 0;
|
|
690
|
+
bottom: 0;
|
|
691
|
+
background: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
|
|
692
|
+
background-size: 6px 6px;
|
|
693
|
+
background-position: 0 0, 0 3px, 3px -3px, -3px 0px;
|
|
694
|
+
z-index: -1;
|
|
695
|
+
}
|
|
696
|
+
/* Dark Mode Support */
|
|
697
|
+
@media (prefers-color-scheme: dark) {
|
|
698
|
+
.colorpicker-container {
|
|
699
|
+
background: #1f2937;
|
|
700
|
+
border-color: #374151;
|
|
701
|
+
color: #e5e7eb;
|
|
702
|
+
}
|
|
703
|
+
.colorpicker-compact-button {
|
|
704
|
+
background: #1f2937;
|
|
705
|
+
border-color: #374151;
|
|
706
|
+
}
|
|
707
|
+
.colorpicker-compact-button:hover {
|
|
708
|
+
border-color: #60a5fa;
|
|
709
|
+
-webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.3);
|
|
710
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.3);
|
|
711
|
+
}
|
|
712
|
+
.colorpicker-compact-button:focus {
|
|
713
|
+
border-color: #60a5fa;
|
|
714
|
+
-webkit-box-shadow: 0 0 0 3px rgba(96,165,250,0.2);
|
|
715
|
+
box-shadow: 0 0 0 3px rgba(96,165,250,0.2);
|
|
716
|
+
}
|
|
717
|
+
.colorpicker-label {
|
|
718
|
+
color: #9ca3af;
|
|
719
|
+
}
|
|
720
|
+
.colorpicker-input {
|
|
721
|
+
background: #111827;
|
|
722
|
+
border-color: #374151;
|
|
723
|
+
color: #f9fafb;
|
|
724
|
+
}
|
|
725
|
+
.colorpicker-input:focus {
|
|
726
|
+
border-color: #60a5fa;
|
|
727
|
+
-webkit-box-shadow: 0 0 0 3px rgba(96,165,250,0.2);
|
|
728
|
+
box-shadow: 0 0 0 3px rgba(96,165,250,0.2);
|
|
729
|
+
}
|
|
730
|
+
.colorpicker-preview-color {
|
|
731
|
+
border-color: #374151;
|
|
732
|
+
}
|
|
733
|
+
.colorpicker-eyedropper-btn {
|
|
734
|
+
background: #1f2937;
|
|
735
|
+
border-color: #374151;
|
|
736
|
+
color: #e5e7eb;
|
|
737
|
+
}
|
|
738
|
+
.colorpicker-eyedropper-btn:hover {
|
|
739
|
+
background: #111827;
|
|
740
|
+
border-color: #60a5fa;
|
|
741
|
+
}
|
|
742
|
+
.colorpicker-eyedropper-btn:focus {
|
|
743
|
+
border-color: #60a5fa;
|
|
744
|
+
-webkit-box-shadow: 0 0 0 3px rgba(96,165,250,0.2);
|
|
745
|
+
box-shadow: 0 0 0 3px rgba(96,165,250,0.2);
|
|
746
|
+
}
|
|
747
|
+
.colorpicker-system-picker-btn {
|
|
748
|
+
background: #1f2937;
|
|
749
|
+
border-color: #374151;
|
|
750
|
+
color: #e5e7eb;
|
|
751
|
+
}
|
|
752
|
+
.colorpicker-system-picker-btn:hover {
|
|
753
|
+
background: #111827;
|
|
754
|
+
border-color: #60a5fa;
|
|
755
|
+
}
|
|
756
|
+
.colorpicker-system-picker-btn:focus {
|
|
757
|
+
border-color: #60a5fa;
|
|
758
|
+
-webkit-box-shadow: 0 0 0 3px rgba(96,165,250,0.2);
|
|
759
|
+
box-shadow: 0 0 0 3px rgba(96,165,250,0.2);
|
|
760
|
+
}
|
|
761
|
+
.colorpicker-slider:focus {
|
|
762
|
+
-webkit-box-shadow: 0 0 0 2px #60a5fa;
|
|
763
|
+
box-shadow: 0 0 0 2px #60a5fa;
|
|
764
|
+
}
|
|
765
|
+
.colorpicker-slider::-webkit-slider-thumb {
|
|
766
|
+
border-color: #60a5fa;
|
|
767
|
+
}
|
|
768
|
+
.colorpicker-slider::-moz-range-thumb {
|
|
769
|
+
border-color: #60a5fa;
|
|
770
|
+
}
|
|
771
|
+
.colorpicker-preset:hover {
|
|
772
|
+
border-color: #60a5fa;
|
|
773
|
+
}
|
|
774
|
+
.colorpicker-preset:focus {
|
|
775
|
+
border-color: #60a5fa;
|
|
776
|
+
}
|
|
777
|
+
.colorpicker-preset-list-item {
|
|
778
|
+
background: #1f2937;
|
|
779
|
+
}
|
|
780
|
+
.colorpicker-preset-list-item:hover {
|
|
781
|
+
background: #111827;
|
|
782
|
+
border-color: #374151;
|
|
783
|
+
}
|
|
784
|
+
.colorpicker-preset-list-item:focus {
|
|
785
|
+
background: #111827;
|
|
786
|
+
border-color: #374151;
|
|
787
|
+
}
|
|
788
|
+
.colorpicker-preset-label {
|
|
789
|
+
color: #e5e7eb;
|
|
790
|
+
}
|
|
791
|
+
.colorpicker-input-group {
|
|
792
|
+
background: #1f2937;
|
|
793
|
+
border-color: #374151;
|
|
794
|
+
}
|
|
795
|
+
.colorpicker-input-group:focus-within {
|
|
796
|
+
border-color: #60a5fa;
|
|
797
|
+
}
|
|
798
|
+
.colorpicker-input-preview {
|
|
799
|
+
border-right-color: #374151;
|
|
800
|
+
}
|
|
801
|
+
input.colorpicker-has-preview {
|
|
802
|
+
color: #f9fafb;
|
|
803
|
+
}
|
|
804
|
+
input.colorpicker-has-preview:focus {
|
|
805
|
+
-webkit-box-shadow: 0 0 0 2px rgba(96,165,250,0.3);
|
|
806
|
+
box-shadow: 0 0 0 2px rgba(96,165,250,0.3);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
/* High Contrast Mode */
|
|
810
|
+
@media (prefers-contrast: high) {
|
|
811
|
+
.colorpicker-container {
|
|
812
|
+
border-width: 2px;
|
|
813
|
+
}
|
|
814
|
+
.colorpicker-saturation {
|
|
815
|
+
outline: 2px solid currentColor;
|
|
816
|
+
}
|
|
817
|
+
.colorpicker-saturation-pointer {
|
|
818
|
+
border-width: 4px;
|
|
819
|
+
}
|
|
820
|
+
.colorpicker-preset {
|
|
821
|
+
border-width: 3px;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
/* Reduced Motion */
|
|
825
|
+
@media (prefers-reduced-motion: reduce) {
|
|
826
|
+
.colorpicker-slider::-webkit-slider-thumb {
|
|
827
|
+
-webkit-transition: none;
|
|
828
|
+
transition: none;
|
|
829
|
+
}
|
|
830
|
+
.colorpicker-slider::-moz-range-thumb {
|
|
831
|
+
-webkit-transition: none;
|
|
832
|
+
transition: none;
|
|
833
|
+
}
|
|
834
|
+
.colorpicker-preset {
|
|
835
|
+
-webkit-transition: none;
|
|
836
|
+
transition: none;
|
|
837
|
+
}
|
|
838
|
+
.colorpicker-input {
|
|
839
|
+
-webkit-transition: none;
|
|
840
|
+
transition: none;
|
|
841
|
+
}
|
|
842
|
+
.colorpicker-saturation-pointer {
|
|
843
|
+
-webkit-transition: none;
|
|
844
|
+
transition: none;
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
/* Animation */
|
|
848
|
+
.colorpicker-container:not([style*="display: none"]) {
|
|
849
|
+
-webkit-animation: colorpicker-fadeIn 0.2s ease-out;
|
|
850
|
+
animation: colorpicker-fadeIn 0.2s ease-out;
|
|
851
|
+
}
|
|
852
|
+
@media (prefers-reduced-motion: reduce) {
|
|
853
|
+
.colorpicker-container:not([style*="display: none"]) {
|
|
854
|
+
-webkit-animation: none;
|
|
855
|
+
animation: none;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
@-webkit-keyframes colorpicker-fadeIn {
|
|
859
|
+
from {
|
|
860
|
+
opacity: 0;
|
|
861
|
+
-webkit-transform: translateY(-8px);
|
|
862
|
+
transform: translateY(-8px);
|
|
863
|
+
}
|
|
864
|
+
to {
|
|
865
|
+
opacity: 1;
|
|
866
|
+
-webkit-transform: translateY(0);
|
|
867
|
+
transform: translateY(0);
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
@keyframes colorpicker-fadeIn {
|
|
871
|
+
from {
|
|
872
|
+
opacity: 0;
|
|
873
|
+
-webkit-transform: translateY(-8px);
|
|
874
|
+
transform: translateY(-8px);
|
|
875
|
+
}
|
|
876
|
+
to {
|
|
877
|
+
opacity: 1;
|
|
878
|
+
-webkit-transform: translateY(0);
|
|
879
|
+
transform: translateY(0);
|
|
880
|
+
}
|
|
881
|
+
}
|