@thednp/color-picker 0.0.1-alpha1 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +63 -26
  3. package/dist/css/color-picker.css +504 -337
  4. package/dist/css/color-picker.min.css +2 -0
  5. package/dist/css/color-picker.rtl.css +529 -0
  6. package/dist/css/color-picker.rtl.min.css +2 -0
  7. package/dist/js/color-picker-element-esm.js +3851 -2
  8. package/dist/js/color-picker-element-esm.min.js +2 -0
  9. package/dist/js/color-picker-element.js +2086 -1278
  10. package/dist/js/color-picker-element.min.js +2 -2
  11. package/dist/js/color-picker-esm.js +3742 -0
  12. package/dist/js/color-picker-esm.min.js +2 -0
  13. package/dist/js/color-picker.js +2030 -1286
  14. package/dist/js/color-picker.min.js +2 -2
  15. package/package.json +18 -9
  16. package/src/js/color-palette.js +71 -0
  17. package/src/js/color-picker-element.js +62 -16
  18. package/src/js/color-picker.js +734 -618
  19. package/src/js/color.js +621 -358
  20. package/src/js/index.js +0 -9
  21. package/src/js/util/colorNames.js +2 -152
  22. package/src/js/util/colorPickerLabels.js +22 -0
  23. package/src/js/util/getColorControls.js +103 -0
  24. package/src/js/util/getColorForm.js +26 -19
  25. package/src/js/util/getColorMenu.js +88 -0
  26. package/src/js/util/isValidJSON.js +13 -0
  27. package/src/js/util/nonColors.js +5 -0
  28. package/src/js/util/roundPart.js +9 -0
  29. package/src/js/util/setCSSProperties.js +12 -0
  30. package/src/js/util/tabindex.js +3 -0
  31. package/src/js/util/templates.js +1 -0
  32. package/src/scss/color-picker.rtl.scss +23 -0
  33. package/src/scss/color-picker.scss +449 -0
  34. package/types/cp.d.ts +263 -162
  35. package/types/index.d.ts +9 -2
  36. package/types/source/source.ts +2 -1
  37. package/types/source/types.d.ts +28 -5
  38. package/dist/js/color-picker.esm.js +0 -2998
  39. package/dist/js/color-picker.esm.min.js +0 -2
  40. package/src/js/util/getColorControl.js +0 -49
  41. package/src/js/util/init.js +0 -14
@@ -0,0 +1,2 @@
1
+ /* ColorPicker v0.0.1 | thednp © 2022 | MIT-License */
2
+ color-picker,.color-picker{position:relative;display:flex}color-picker:focus,.color-picker:focus{outline:none}.color-dropdown{position:absolute;z-index:50;display:none;flex-direction:column;width:min-content;padding:.5rem;color:rgba(255,255,255,.8);background:rgba(0,0,0,.75);border-radius:.5rem;box-shadow:0 6px 12px rgba(0,0,0,.4);opacity:0;transition:transform .33s ease,opacity .33s ease}.color-dropdown.picker{left:0}.color-dropdown.menu{right:0}.open .color-dropdown.top{top:auto;bottom:100%}.color-dropdown.bottom{top:100%}.open .color-dropdown.top,.open .color-dropdown.bottom{display:flex}.color-dropdown.show{opacity:1}.color-dropdown.show.top{transform:translate(0, -5px)}.color-dropdown.show.bottom{transform:translate(0, 5px)}.color-controls{display:none;flex-wrap:wrap;justify-content:space-between;width:max-content}.btn-appearance{width:100%;height:1.5rem;padding:.6rem 1rem;font-size:1rem;line-height:1.5;border:0;border-radius:.25rem;outline:none;appearance:none;transition-duration:.33s;transition-property:box-shadow,border}.btn-appearance:focus,.btn-appearance:hover{box-shadow:0 0 0 3px rgba(0,0,0,.15)}.color-preview{box-shadow:0 0 0 1px rgba(120,120,120,.33) inset;direction:ltr}.txt-dark .color-preview{color:rgba(255,255,255,.8)}.txt-dark .color-preview:focus{box-shadow:0 0 0 1px #fff inset,0 0 0 3px rgba(0,0,0,.15)}.txt-dark .color-preview::placeholder{color:rgba(255,255,255,.6)}.txt-light .color-preview{color:rgba(0,0,0,.8)}.txt-light .color-preview:focus{color:rgba(0,0,0,.8);box-shadow:0 0 0 1px rgba(0,0,0,.5) inset,0 0 0 3px rgba(0,0,0,.15)}.txt-light .color-preview::placeholder{color:rgba(0,0,0,.6)}.picker-toggle{position:absolute;top:0;left:0;width:100%;height:100%;background:transparent;border:0}.open .picker-toggle{z-index:-1}.menu-toggle{position:absolute;top:0;right:0;display:flex;width:3rem;height:100%;padding:0 .25rem;cursor:pointer;border:0;border-radius:0 .25rem .25rem 0}.txt-light .menu-toggle{background:rgba(0,0,0,.5)}.txt-light .menu-toggle:focus,.txt-light .menu-toggle:focus{background:rgba(0,0,0,.7)}.txt-dark .menu-toggle{background:rgba(255,255,255,.33)}.txt-dark .menu-toggle:focus,.txt-dark .menu-toggle:focus{background:rgba(255,255,255,.5)}.menu-toggle svg{width:auto;height:100%}.scrollable{overflow-x:hidden;overflow-y:auto;scrollbar-width:thin}.scrollable::-webkit-scrollbar{width:.5rem}.scrollable::-webkit-scrollbar-track{background-color:transparent}.scrollable::-webkit-scrollbar-thumb{width:.5rem;background-color:transparent;background-clip:content-box;border:0}.scrollable:hover::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.33)}.scrollable::-webkit-scrollbar-thumb:hover{background-color:#fff}.color-defaults{display:none;flex-wrap:wrap;flex-flow:column;margin:0;list-style:none;padding-inline:0}.color-dropdown.menu .color-defaults,.color-dropdown.picker .color-controls{display:flex}.color-dropdown.menu{max-height:230px}.color-defaults .color-option{padding:.25rem .5rem;color:inherit}.color-option{cursor:pointer}.color-defaults .color-option:focus,.color-defaults .color-option:hover{background:rgba(255,255,255,.3);outline:none}.color-defaults .color-option:active,.color-defaults .color-option.active{color:#000;background:#fff}.color-options{display:grid;padding:0;margin:0;list-style:none;--grid-item-size: 2rem;--grid-fit: 5;--grid-gap: .25rem;--grid-height: auto;--grid-hover-height: auto;grid-template-columns:repeat(var(--grid-fit), var(--grid-item-size));grid-template-rows:repeat(auto-fill, var(--grid-item-size));gap:var(--grid-gap)}.color-options.scrollable{height:var(--grid-height);margin:0 -0.5rem 0 0;overflow-y:scroll;transition:height .33s ease}.color-options.scrollable:hover{height:var(--grid-hover-height)}.color-options+.color-defaults{margin-top:.25rem}.multiline+.color-defaults{flex-direction:row;flex-wrap:wrap}.multiline+.color-defaults .color-option{padding:.25rem .33rem;font-size:12px}.color-options .color-option{position:relative;width:var(--grid-item-size);height:var(--grid-item-size);overflow:hidden;text-indent:2.1rem}.color-options .color-option:active,.color-options .color-option:focus{outline:none}.color-options .color-option::before{position:absolute;top:0;right:0;bottom:0;left:0}.color-options .color-option:hover::before,.color-options .color-option:active::before,.color-options .color-option:focus::before{content:"";border:3px solid rgba(255,255,255,.75);mix-blend-mode:difference}.color-options .color-option:active,.color-options .color-option:focus{box-shadow:0 0 0 4px rgba(125,125,125,.75) inset}.color-options .color-option.active:after{position:absolute;top:50%;left:50%;width:4px;height:4px;margin:-2px 0 0 -2px;content:"";border-radius:4px}.txt-dark .color-options .color-option.active:after{box-shadow:0 0 0 4px rgba(255,255,255,.9)}.txt-light .color-options .color-option.active:after{box-shadow:0 0 0 4px rgba(0,0,0,.9)}.color-form{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;padding:.25rem 0 0;font:12px sans-serif}.color-form.hex{max-width:initial}.color-form>*{flex:1 0 0%;width:17.5%;max-width:17.5%}.color-form label{width:7.5%;max-width:7.5%;text-align:center}.color-input{color:inherit;text-align:right;background:transparent;border:1px solid rgba(255,255,255,.15);outline:none}.color-input.hex{width:92.5%;max-width:92.5%}.color-input:active,.color-input:focus{background:rgba(0,0,0,.25);border:1px solid rgba(255,255,255,.33)}.visual-control{height:150px}.visual-control1{width:150px}.visual-control2,.visual-control3{width:21px;cursor:ns-resize}@media(min-width: 578px){.visual-control{height:230px}.visual-control1{width:230px}}@media(min-width: 1200px){.visual-control{height:300px}.visual-control1{width:300px}}.color-control{position:relative;display:inline-block}.color-slider{left:0;width:calc(100% - 2px);cursor:ns-resize}.color-control+.color-control{margin-left:.5rem}.knob{position:absolute;top:0;left:0;height:7px;user-select:none;background-color:#000;border:1px solid #fff;border-radius:5px;outline:none;will-change:transform}.knob:hover{box-shadow:0 0 0 6px rgba(255,255,255,.5)}.knob:focus,.knob:active{z-index:1;box-shadow:0 0 0 6px rgba(255,255,255,.9)}.color-pointer{width:7px;background-color:transparent;border:0}.txt-dark .color-pointer{box-shadow:0 0 0 5px rgba(255,255,255,.5)}.txt-light .color-pointer{box-shadow:0 0 0 5px rgba(0,0,0,.5)}.txt-dark .color-pointer:hover{box-shadow:0 0 0 5px rgba(255,255,255,.75)}.txt-light .color-pointer:hover{box-shadow:0 0 0 5px rgba(0,0,0,.75)}.txt-dark .color-pointer:focus,.txt-dark .color-pointer:active{box-shadow:0 0 0 5px rgba(255,255,255,.9)}.txt-light .color-pointer:focus,.txt-light .color-pointer:active{box-shadow:0 0 0 5px rgba(0,0,0,.9)}.v-hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}
@@ -0,0 +1,529 @@
1
+ /*!
2
+ * ColorPicker v0.0.1 (http://thednp.github.io/color-picker)
3
+ * Copyright 2022 © thednp
4
+ * Licensed under MIT (https://github.com/thednp/color-picker/blob/master/LICENSE)
5
+ */
6
+ /* :host */
7
+ color-picker,
8
+ .color-picker {
9
+ position: relative;
10
+ display: flex;
11
+ }
12
+
13
+ color-picker:focus,
14
+ .color-picker:focus {
15
+ outline: none;
16
+ }
17
+
18
+ /* color-dropdown */
19
+ .color-dropdown {
20
+ position: absolute;
21
+ z-index: 50;
22
+ display: none;
23
+ flex-direction: column;
24
+ width: min-content;
25
+ padding: 0.5rem;
26
+ color: rgba(255, 255, 255, 0.8);
27
+ background: rgba(0, 0, 0, 0.75);
28
+ border-radius: 0.5rem;
29
+ box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
30
+ opacity: 0;
31
+ transition: transform 0.33s ease, opacity 0.33s ease;
32
+ }
33
+
34
+ .color-dropdown.picker {
35
+ left: 0;
36
+ }
37
+
38
+ .color-dropdown.menu {
39
+ right: 0;
40
+ }
41
+
42
+ .open .color-dropdown.top {
43
+ top: auto;
44
+ bottom: 100%;
45
+ }
46
+
47
+ .color-dropdown.bottom {
48
+ top: 100%;
49
+ }
50
+
51
+ .open .color-dropdown.top,
52
+ .open .color-dropdown.bottom {
53
+ display: flex;
54
+ }
55
+
56
+ .color-dropdown.show {
57
+ opacity: 1;
58
+ }
59
+
60
+ .color-dropdown.show.top {
61
+ transform: translate(0, -5px);
62
+ }
63
+
64
+ .color-dropdown.show.bottom {
65
+ transform: translate(0, 5px);
66
+ }
67
+
68
+ /* color-controls */
69
+ .color-controls {
70
+ display: none;
71
+ flex-wrap: wrap;
72
+ justify-content: space-between;
73
+ width: max-content;
74
+ }
75
+
76
+ /* btn-appearance */
77
+ .btn-appearance {
78
+ width: 100%;
79
+ height: 1.5rem;
80
+ padding: 0.6rem 1rem;
81
+ font-size: 1rem;
82
+ line-height: 1.5;
83
+ border: 0;
84
+ border-radius: 0.25rem;
85
+ outline: none;
86
+ appearance: none;
87
+ transition-duration: 0.33s;
88
+ transition-property: box-shadow, border;
89
+ }
90
+
91
+ .btn-appearance:focus,
92
+ .btn-appearance:hover {
93
+ box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.15);
94
+ }
95
+
96
+ /* color-preview */
97
+ .color-preview {
98
+ box-shadow: 0 0 0 1px rgba(120, 120, 120, 0.33) inset;
99
+ direction: ltr;
100
+ /* color value can never be rtl */
101
+ }
102
+
103
+ .txt-dark .color-preview {
104
+ color: rgba(255, 255, 255, 0.8);
105
+ }
106
+
107
+ .txt-dark .color-preview:focus {
108
+ box-shadow: 0 0 0 1px white inset, 0 0 0 3px rgba(0, 0, 0, 0.15);
109
+ }
110
+
111
+ .txt-dark .color-preview::placeholder {
112
+ color: rgba(255, 255, 255, 0.6);
113
+ }
114
+
115
+ .txt-light .color-preview {
116
+ color: rgba(0, 0, 0, 0.8);
117
+ }
118
+
119
+ .txt-light .color-preview:focus {
120
+ color: rgba(0, 0, 0, 0.8);
121
+ box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5) inset, 0 0 0 3px rgba(0, 0, 0, 0.15);
122
+ }
123
+
124
+ .txt-light .color-preview::placeholder {
125
+ color: rgba(0, 0, 0, 0.6);
126
+ }
127
+
128
+ /* picker-toggle */
129
+ .picker-toggle {
130
+ position: absolute;
131
+ top: 0;
132
+ left: 0;
133
+ width: 100%;
134
+ height: 100%;
135
+ background: transparent;
136
+ border: 0;
137
+ }
138
+
139
+ .open .picker-toggle {
140
+ z-index: -1;
141
+ }
142
+
143
+ /* menu-toggle */
144
+ .menu-toggle {
145
+ position: absolute;
146
+ top: 0;
147
+ right: 0;
148
+ display: flex;
149
+ width: 3rem;
150
+ height: 100%;
151
+ padding: 0 0.25rem;
152
+ cursor: pointer;
153
+ border: 0;
154
+ border-radius: 0 0.25rem 0.25rem 0;
155
+ }
156
+
157
+ .txt-light .menu-toggle {
158
+ background: rgba(0, 0, 0, 0.5);
159
+ }
160
+
161
+ .txt-light .menu-toggle:focus,
162
+ .txt-light .menu-toggle:focus {
163
+ background: rgba(0, 0, 0, 0.7);
164
+ }
165
+
166
+ .txt-dark .menu-toggle {
167
+ background: rgba(255, 255, 255, 0.33);
168
+ }
169
+
170
+ .txt-dark .menu-toggle:focus,
171
+ .txt-dark .menu-toggle:focus {
172
+ background: rgba(255, 255, 255, 0.5);
173
+ }
174
+
175
+ .menu-toggle svg {
176
+ width: auto;
177
+ height: 100%;
178
+ }
179
+
180
+ /* scrollable */
181
+ .scrollable {
182
+ overflow-x: hidden;
183
+ overflow-y: auto;
184
+ scrollbar-width: thin;
185
+ }
186
+
187
+ .scrollable::-webkit-scrollbar {
188
+ width: 0.5rem;
189
+ }
190
+
191
+ .scrollable::-webkit-scrollbar-track {
192
+ background-color: transparent;
193
+ }
194
+
195
+ .scrollable::-webkit-scrollbar-thumb {
196
+ width: 0.5rem;
197
+ background-color: transparent;
198
+ background-clip: content-box;
199
+ border: 0;
200
+ }
201
+
202
+ .scrollable:hover::-webkit-scrollbar-thumb {
203
+ background-color: rgba(255, 255, 255, 0.33);
204
+ }
205
+
206
+ .scrollable::-webkit-scrollbar-thumb:hover {
207
+ background-color: #fff;
208
+ }
209
+
210
+ /* color-defaults */
211
+ .color-defaults {
212
+ display: none;
213
+ flex-wrap: wrap;
214
+ flex-flow: column;
215
+ margin: 0;
216
+ list-style: none;
217
+ padding-inline: 0;
218
+ }
219
+
220
+ .color-dropdown.menu .color-defaults,
221
+ .color-dropdown.picker .color-controls {
222
+ display: flex;
223
+ }
224
+
225
+ .color-dropdown.menu {
226
+ max-height: 230px;
227
+ }
228
+
229
+ .color-defaults .color-option {
230
+ padding: 0.25rem 0.5rem;
231
+ color: inherit;
232
+ }
233
+
234
+ .color-option {
235
+ cursor: pointer;
236
+ }
237
+
238
+ .color-defaults .color-option:focus,
239
+ .color-defaults .color-option:hover {
240
+ background: rgba(255, 255, 255, 0.3);
241
+ outline: none;
242
+ }
243
+
244
+ .color-defaults .color-option:active,
245
+ .color-defaults .color-option.active {
246
+ color: #000;
247
+ background: #fff;
248
+ }
249
+
250
+ /* color-options grid */
251
+ .color-options {
252
+ display: grid;
253
+ padding: 0;
254
+ margin: 0;
255
+ list-style: none;
256
+ --grid-item-size: 2rem;
257
+ --grid-fit: 5;
258
+ --grid-gap: .25rem;
259
+ --grid-height: auto;
260
+ --grid-hover-height: auto;
261
+ grid-template-columns: repeat(var(--grid-fit), var(--grid-item-size));
262
+ grid-template-rows: repeat(auto-fill, var(--grid-item-size));
263
+ gap: var(--grid-gap);
264
+ }
265
+
266
+ .color-options.scrollable {
267
+ height: var(--grid-height);
268
+ margin: 0 -0.5rem 0 0;
269
+ overflow-y: scroll;
270
+ transition: height 0.33s ease;
271
+ }
272
+
273
+ .color-options.scrollable:hover {
274
+ height: var(--grid-hover-height);
275
+ }
276
+
277
+ .color-options + .color-defaults {
278
+ margin-top: 0.25rem;
279
+ }
280
+
281
+ .multiline + .color-defaults {
282
+ flex-direction: row;
283
+ flex-wrap: wrap;
284
+ }
285
+ .multiline + .color-defaults .color-option {
286
+ padding: 0.25rem 0.33rem;
287
+ font-size: 12px;
288
+ }
289
+
290
+ .color-options .color-option {
291
+ position: relative;
292
+ width: var(--grid-item-size);
293
+ height: var(--grid-item-size);
294
+ overflow: hidden;
295
+ text-indent: 2.1rem;
296
+ }
297
+
298
+ .color-options .color-option:active,
299
+ .color-options .color-option:focus {
300
+ outline: none;
301
+ }
302
+
303
+ .color-options .color-option::before {
304
+ position: absolute;
305
+ top: 0;
306
+ right: 0;
307
+ bottom: 0;
308
+ left: 0;
309
+ }
310
+
311
+ .color-options .color-option:hover::before,
312
+ .color-options .color-option:active::before,
313
+ .color-options .color-option:focus::before {
314
+ content: "";
315
+ border: 3px solid rgba(255, 255, 255, 0.75);
316
+ mix-blend-mode: difference;
317
+ }
318
+
319
+ .color-options .color-option:active,
320
+ .color-options .color-option:focus {
321
+ box-shadow: 0 0 0 4px rgba(125, 125, 125, 0.75) inset;
322
+ }
323
+
324
+ .color-options .color-option.active:after {
325
+ position: absolute;
326
+ top: 50%;
327
+ left: 50%;
328
+ width: 4px;
329
+ height: 4px;
330
+ margin: -2px 0 0 -2px;
331
+ content: "";
332
+ border-radius: 4px;
333
+ }
334
+
335
+ .txt-dark .color-options .color-option.active:after {
336
+ box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9);
337
+ }
338
+
339
+ .txt-light .color-options .color-option.active:after {
340
+ box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.9);
341
+ }
342
+
343
+ /* color-form */
344
+ .color-form {
345
+ display: flex;
346
+ flex-direction: row;
347
+ flex-wrap: wrap;
348
+ align-items: center;
349
+ padding: 0.25rem 0 0;
350
+ font: 12px sans-serif;
351
+ }
352
+
353
+ .color-form.hex {
354
+ max-width: initial;
355
+ }
356
+
357
+ .color-form > * {
358
+ flex: 1 0 0%;
359
+ width: 17.5%;
360
+ max-width: 17.5%;
361
+ }
362
+
363
+ .color-form label {
364
+ width: 7.5%;
365
+ max-width: 7.5%;
366
+ text-align: center;
367
+ }
368
+
369
+ .color-input {
370
+ color: inherit;
371
+ text-align: right;
372
+ background: transparent;
373
+ border: 1px solid rgba(255, 255, 255, 0.15);
374
+ outline: none;
375
+ }
376
+
377
+ .color-input.hex {
378
+ width: 92.5%;
379
+ max-width: 92.5%;
380
+ /* width: calc(100% - 4% - 1rem); */
381
+ }
382
+
383
+ .color-input:active,
384
+ .color-input:focus {
385
+ background: rgba(0, 0, 0, 0.25);
386
+ border: 1px solid rgba(255, 255, 255, 0.33);
387
+ }
388
+
389
+ /* visual control */
390
+ .visual-control {
391
+ height: 150px;
392
+ }
393
+
394
+ .visual-control1 {
395
+ width: 150px;
396
+ }
397
+
398
+ .visual-control2,
399
+ .visual-control3 {
400
+ width: 21px;
401
+ cursor: ns-resize;
402
+ }
403
+
404
+ @media (min-width: 578px) {
405
+ .visual-control {
406
+ height: 230px;
407
+ }
408
+
409
+ .visual-control1 {
410
+ width: 230px;
411
+ }
412
+ }
413
+ @media (min-width: 1200px) {
414
+ .visual-control {
415
+ height: 300px;
416
+ }
417
+
418
+ .visual-control1 {
419
+ width: 300px;
420
+ }
421
+ }
422
+ .color-control {
423
+ position: relative;
424
+ display: inline-block;
425
+ }
426
+
427
+ .color-slider {
428
+ left: 0;
429
+ width: calc(100% - 2px);
430
+ cursor: ns-resize;
431
+ }
432
+
433
+ .color-control + .color-control {
434
+ margin-left: 0.5rem;
435
+ }
436
+
437
+ /* knob */
438
+ .knob {
439
+ position: absolute;
440
+ top: 0;
441
+ left: 0;
442
+ height: 7px;
443
+ user-select: none;
444
+ background-color: #000;
445
+ border: 1px solid #fff;
446
+ border-radius: 5px;
447
+ outline: none;
448
+ will-change: transform;
449
+ }
450
+
451
+ .knob:hover {
452
+ box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.5);
453
+ }
454
+
455
+ .knob:focus,
456
+ .knob:active {
457
+ z-index: 1;
458
+ box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.9);
459
+ }
460
+
461
+ /* color-pointer */
462
+ .color-pointer {
463
+ width: 7px;
464
+ background-color: transparent;
465
+ border: 0;
466
+ }
467
+
468
+ .txt-dark .color-pointer {
469
+ box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.5);
470
+ }
471
+
472
+ .txt-light .color-pointer {
473
+ box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.5);
474
+ }
475
+
476
+ .txt-dark .color-pointer:hover {
477
+ box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.75);
478
+ }
479
+
480
+ .txt-light .color-pointer:hover {
481
+ box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.75);
482
+ }
483
+
484
+ .txt-dark .color-pointer:focus,
485
+ .txt-dark .color-pointer:active {
486
+ box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.9);
487
+ }
488
+
489
+ .txt-light .color-pointer:focus,
490
+ .txt-light .color-pointer:active {
491
+ box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.9);
492
+ }
493
+
494
+ /* utility */
495
+ .v-hidden {
496
+ position: absolute !important;
497
+ width: 1px !important;
498
+ height: 1px !important;
499
+ padding: 0 !important;
500
+ margin: -1px !important;
501
+ overflow: hidden !important;
502
+ clip: rect(0, 0, 0, 0) !important;
503
+ white-space: nowrap !important;
504
+ border: 0 !important;
505
+ }
506
+
507
+ [dir=rtl] .color-preview {
508
+ text-align: right;
509
+ }
510
+ [dir=rtl] .menu-toggle {
511
+ right: auto;
512
+ left: 0;
513
+ border-radius: 0.25rem 0 0 0.25rem;
514
+ }
515
+ [dir=rtl] .color-dropdown.picker {
516
+ right: 0;
517
+ left: auto;
518
+ }
519
+ [dir=rtl] .color-dropdown.menu {
520
+ right: auto;
521
+ left: 0;
522
+ }
523
+ [dir=rtl] .color-control + .color-control {
524
+ margin-right: 0.5rem;
525
+ margin-left: 0;
526
+ }
527
+ [dir=rtl] .color-options.scrollable {
528
+ margin: 0 0 0 -0.5rem;
529
+ }
@@ -0,0 +1,2 @@
1
+ /* ColorPicker RTL v0.0.1 | thednp © 2022 | MIT-License */
2
+ color-picker,.color-picker{position:relative;display:flex}color-picker:focus,.color-picker:focus{outline:none}.color-dropdown{position:absolute;z-index:50;display:none;flex-direction:column;width:min-content;padding:.5rem;color:rgba(255,255,255,.8);background:rgba(0,0,0,.75);border-radius:.5rem;box-shadow:0 6px 12px rgba(0,0,0,.4);opacity:0;transition:transform .33s ease,opacity .33s ease}.color-dropdown.picker{left:0}.color-dropdown.menu{right:0}.open .color-dropdown.top{top:auto;bottom:100%}.color-dropdown.bottom{top:100%}.open .color-dropdown.top,.open .color-dropdown.bottom{display:flex}.color-dropdown.show{opacity:1}.color-dropdown.show.top{transform:translate(0, -5px)}.color-dropdown.show.bottom{transform:translate(0, 5px)}.color-controls{display:none;flex-wrap:wrap;justify-content:space-between;width:max-content}.btn-appearance{width:100%;height:1.5rem;padding:.6rem 1rem;font-size:1rem;line-height:1.5;border:0;border-radius:.25rem;outline:none;appearance:none;transition-duration:.33s;transition-property:box-shadow,border}.btn-appearance:focus,.btn-appearance:hover{box-shadow:0 0 0 3px rgba(0,0,0,.15)}.color-preview{box-shadow:0 0 0 1px rgba(120,120,120,.33) inset;direction:ltr}.txt-dark .color-preview{color:rgba(255,255,255,.8)}.txt-dark .color-preview:focus{box-shadow:0 0 0 1px #fff inset,0 0 0 3px rgba(0,0,0,.15)}.txt-dark .color-preview::placeholder{color:rgba(255,255,255,.6)}.txt-light .color-preview{color:rgba(0,0,0,.8)}.txt-light .color-preview:focus{color:rgba(0,0,0,.8);box-shadow:0 0 0 1px rgba(0,0,0,.5) inset,0 0 0 3px rgba(0,0,0,.15)}.txt-light .color-preview::placeholder{color:rgba(0,0,0,.6)}.picker-toggle{position:absolute;top:0;left:0;width:100%;height:100%;background:transparent;border:0}.open .picker-toggle{z-index:-1}.menu-toggle{position:absolute;top:0;right:0;display:flex;width:3rem;height:100%;padding:0 .25rem;cursor:pointer;border:0;border-radius:0 .25rem .25rem 0}.txt-light .menu-toggle{background:rgba(0,0,0,.5)}.txt-light .menu-toggle:focus,.txt-light .menu-toggle:focus{background:rgba(0,0,0,.7)}.txt-dark .menu-toggle{background:rgba(255,255,255,.33)}.txt-dark .menu-toggle:focus,.txt-dark .menu-toggle:focus{background:rgba(255,255,255,.5)}.menu-toggle svg{width:auto;height:100%}.scrollable{overflow-x:hidden;overflow-y:auto;scrollbar-width:thin}.scrollable::-webkit-scrollbar{width:.5rem}.scrollable::-webkit-scrollbar-track{background-color:transparent}.scrollable::-webkit-scrollbar-thumb{width:.5rem;background-color:transparent;background-clip:content-box;border:0}.scrollable:hover::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.33)}.scrollable::-webkit-scrollbar-thumb:hover{background-color:#fff}.color-defaults{display:none;flex-wrap:wrap;flex-flow:column;margin:0;list-style:none;padding-inline:0}.color-dropdown.menu .color-defaults,.color-dropdown.picker .color-controls{display:flex}.color-dropdown.menu{max-height:230px}.color-defaults .color-option{padding:.25rem .5rem;color:inherit}.color-option{cursor:pointer}.color-defaults .color-option:focus,.color-defaults .color-option:hover{background:rgba(255,255,255,.3);outline:none}.color-defaults .color-option:active,.color-defaults .color-option.active{color:#000;background:#fff}.color-options{display:grid;padding:0;margin:0;list-style:none;--grid-item-size: 2rem;--grid-fit: 5;--grid-gap: .25rem;--grid-height: auto;--grid-hover-height: auto;grid-template-columns:repeat(var(--grid-fit), var(--grid-item-size));grid-template-rows:repeat(auto-fill, var(--grid-item-size));gap:var(--grid-gap)}.color-options.scrollable{height:var(--grid-height);margin:0 -0.5rem 0 0;overflow-y:scroll;transition:height .33s ease}.color-options.scrollable:hover{height:var(--grid-hover-height)}.color-options+.color-defaults{margin-top:.25rem}.multiline+.color-defaults{flex-direction:row;flex-wrap:wrap}.multiline+.color-defaults .color-option{padding:.25rem .33rem;font-size:12px}.color-options .color-option{position:relative;width:var(--grid-item-size);height:var(--grid-item-size);overflow:hidden;text-indent:2.1rem}.color-options .color-option:active,.color-options .color-option:focus{outline:none}.color-options .color-option::before{position:absolute;top:0;right:0;bottom:0;left:0}.color-options .color-option:hover::before,.color-options .color-option:active::before,.color-options .color-option:focus::before{content:"";border:3px solid rgba(255,255,255,.75);mix-blend-mode:difference}.color-options .color-option:active,.color-options .color-option:focus{box-shadow:0 0 0 4px rgba(125,125,125,.75) inset}.color-options .color-option.active:after{position:absolute;top:50%;left:50%;width:4px;height:4px;margin:-2px 0 0 -2px;content:"";border-radius:4px}.txt-dark .color-options .color-option.active:after{box-shadow:0 0 0 4px rgba(255,255,255,.9)}.txt-light .color-options .color-option.active:after{box-shadow:0 0 0 4px rgba(0,0,0,.9)}.color-form{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;padding:.25rem 0 0;font:12px sans-serif}.color-form.hex{max-width:initial}.color-form>*{flex:1 0 0%;width:17.5%;max-width:17.5%}.color-form label{width:7.5%;max-width:7.5%;text-align:center}.color-input{color:inherit;text-align:right;background:transparent;border:1px solid rgba(255,255,255,.15);outline:none}.color-input.hex{width:92.5%;max-width:92.5%}.color-input:active,.color-input:focus{background:rgba(0,0,0,.25);border:1px solid rgba(255,255,255,.33)}.visual-control{height:150px}.visual-control1{width:150px}.visual-control2,.visual-control3{width:21px;cursor:ns-resize}@media(min-width: 578px){.visual-control{height:230px}.visual-control1{width:230px}}@media(min-width: 1200px){.visual-control{height:300px}.visual-control1{width:300px}}.color-control{position:relative;display:inline-block}.color-slider{left:0;width:calc(100% - 2px);cursor:ns-resize}.color-control+.color-control{margin-left:.5rem}.knob{position:absolute;top:0;left:0;height:7px;user-select:none;background-color:#000;border:1px solid #fff;border-radius:5px;outline:none;will-change:transform}.knob:hover{box-shadow:0 0 0 6px rgba(255,255,255,.5)}.knob:focus,.knob:active{z-index:1;box-shadow:0 0 0 6px rgba(255,255,255,.9)}.color-pointer{width:7px;background-color:transparent;border:0}.txt-dark .color-pointer{box-shadow:0 0 0 5px rgba(255,255,255,.5)}.txt-light .color-pointer{box-shadow:0 0 0 5px rgba(0,0,0,.5)}.txt-dark .color-pointer:hover{box-shadow:0 0 0 5px rgba(255,255,255,.75)}.txt-light .color-pointer:hover{box-shadow:0 0 0 5px rgba(0,0,0,.75)}.txt-dark .color-pointer:focus,.txt-dark .color-pointer:active{box-shadow:0 0 0 5px rgba(255,255,255,.9)}.txt-light .color-pointer:focus,.txt-light .color-pointer:active{box-shadow:0 0 0 5px rgba(0,0,0,.9)}.v-hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}[dir=rtl] .color-preview{text-align:right}[dir=rtl] .menu-toggle{right:auto;left:0;border-radius:.25rem 0 0 .25rem}[dir=rtl] .color-dropdown.picker{right:0;left:auto}[dir=rtl] .color-dropdown.menu{right:auto;left:0}[dir=rtl] .color-control+.color-control{margin-right:.5rem;margin-left:0}[dir=rtl] .color-options.scrollable{margin:0 0 0 -0.5rem}