coloris 0.0.2 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2c19bec0ed05c159bc9aea924c8218dcbaa5eaa4a45a0826ae56400b1fac018
4
- data.tar.gz: 4d8787589f9a983a1af449c4d4ef49e3e2c53bb9dbcef9ffbce51c7727cfc881
3
+ metadata.gz: ea65c62819a1ea3fc5d3764213253eed3ffe697b720ac1f8f580437967aff574
4
+ data.tar.gz: e6ba7115e29d79bcd62ac1b62ad5505d58b72c5dd5598704428de577881616c2
5
5
  SHA512:
6
- metadata.gz: 4788d2d0e52c542219bae10230f735a3a1d11518dafd69d6dbed222124074240b39dcffe6ad60736bb9f8b2c06efbc34317e20a9920401e8c422a0c3e68d2bb9
7
- data.tar.gz: ecb1a93509fc1057a012e58b13a9c2412b71a8dd29c11372048eacaaaa57a6561444edac4dedcc3e06a8d58dbd92d433ab4e0f5ebb0129eab2c817da84ea4b39
6
+ metadata.gz: c7da4481584f994ca73d68bd21457c13d4c4de7105e4163d809d3581e7efd6da17559cebda75bcef8f2a4b532a276b3892126a73e27b36611971102e82070a5e
7
+ data.tar.gz: 5703cb1734a6b16aaed2e4acb0591296526bb9e1f2327c63a1c84ee96469f3f97622c0fce5bce0d722541b4da0c23255621be04f4e2e2788c5b9562a8f6fbd9a
@@ -1,6 +1,6 @@
1
1
  module Coloris
2
2
  class InstallGenerator < Rails::Generators::Base
3
- source_root File.expand_path("../../coloris_assets", __FILE__)
3
+ source_root File.expand_path("../templates", __FILE__)
4
4
  def install
5
5
  copy_file "coloris.css", "app/assets/stylesheets/coloris.css"
6
6
  copy_file "coloris.js", "app/javascript/coloris.js"
@@ -0,0 +1,577 @@
1
+ .clr-picker {
2
+ display: none;
3
+ flex-wrap: wrap;
4
+ position: absolute;
5
+ width: 200px;
6
+ z-index: 1000;
7
+ border-radius: 10px;
8
+ background-color: #fff;
9
+ justify-content: flex-end;
10
+ direction: ltr;
11
+ box-shadow: 0 0 5px rgba(0,0,0,.05), 0 5px 20px rgba(0,0,0,.1);
12
+ -moz-user-select: none;
13
+ -webkit-user-select: none;
14
+ user-select: none;
15
+ }
16
+
17
+ .clr-picker.clr-open,
18
+ .clr-picker[data-inline="true"] {
19
+ display: flex;
20
+ }
21
+
22
+ .clr-picker[data-inline="true"] {
23
+ position: relative;
24
+ }
25
+
26
+ .clr-gradient {
27
+ position: relative;
28
+ width: 100%;
29
+ height: 100px;
30
+ margin-bottom: 15px;
31
+ border-radius: 3px 3px 0 0;
32
+ background-image: linear-gradient(rgba(0,0,0,0), #000), linear-gradient(90deg, #fff, currentColor);
33
+ cursor: pointer;
34
+ }
35
+
36
+ .clr-marker {
37
+ position: absolute;
38
+ width: 12px;
39
+ height: 12px;
40
+ margin: -6px 0 0 -6px;
41
+ border: 1px solid #fff;
42
+ border-radius: 50%;
43
+ background-color: currentColor;
44
+ cursor: pointer;
45
+ }
46
+
47
+ .clr-picker input[type="range"]::-webkit-slider-runnable-track {
48
+ width: 100%;
49
+ height: 16px;
50
+ }
51
+
52
+ .clr-picker input[type="range"]::-webkit-slider-thumb {
53
+ width: 16px;
54
+ height: 16px;
55
+ -webkit-appearance: none;
56
+ }
57
+
58
+ .clr-picker input[type="range"]::-moz-range-track {
59
+ width: 100%;
60
+ height: 16px;
61
+ border: 0;
62
+ }
63
+
64
+ .clr-picker input[type="range"]::-moz-range-thumb {
65
+ width: 16px;
66
+ height: 16px;
67
+ border: 0;
68
+ }
69
+
70
+ .clr-hue {
71
+ background-image: linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%);
72
+ }
73
+
74
+ .clr-hue,
75
+ .clr-alpha {
76
+ position: relative;
77
+ width: calc(100% - 40px);
78
+ height: 8px;
79
+ margin: 5px 20px;
80
+ border-radius: 4px;
81
+ }
82
+
83
+ .clr-alpha span {
84
+ display: block;
85
+ height: 100%;
86
+ width: 100%;
87
+ border-radius: inherit;
88
+ background-image: linear-gradient(90deg, rgba(0,0,0,0), currentColor);
89
+ }
90
+
91
+ .clr-hue input[type="range"],
92
+ .clr-alpha input[type="range"] {
93
+ position: absolute;
94
+ width: calc(100% + 32px);
95
+ height: 16px;
96
+ left: -16px;
97
+ top: -4px;
98
+ margin: 0;
99
+ background-color: transparent;
100
+ opacity: 0;
101
+ cursor: pointer;
102
+ appearance: none;
103
+ -webkit-appearance: none;
104
+ }
105
+
106
+ .clr-hue div,
107
+ .clr-alpha div {
108
+ position: absolute;
109
+ width: 16px;
110
+ height: 16px;
111
+ left: 0;
112
+ top: 50%;
113
+ margin-left: -8px;
114
+ transform: translateY(-50%);
115
+ border: 2px solid #fff;
116
+ border-radius: 50%;
117
+ background-color: currentColor;
118
+ box-shadow: 0 0 1px #888;
119
+ pointer-events: none;
120
+ }
121
+
122
+ .clr-alpha div:before {
123
+ content: '';
124
+ position: absolute;
125
+ height: 100%;
126
+ width: 100%;
127
+ left: 0;
128
+ top: 0;
129
+ border-radius: 50%;
130
+ background-color: currentColor;
131
+ }
132
+
133
+ .clr-format {
134
+ display: none;
135
+ order: 1;
136
+ width: calc(100% - 40px);
137
+ margin: 0 20px 20px;
138
+ }
139
+
140
+ .clr-segmented {
141
+ display: flex;
142
+ position: relative;
143
+ width: 100%;
144
+ margin: 0;
145
+ padding: 0;
146
+ border: 1px solid #ddd;
147
+ border-radius: 15px;
148
+ box-sizing: border-box;
149
+ color: #999;
150
+ font-size: 12px;
151
+ }
152
+
153
+ .clr-segmented input,
154
+ .clr-segmented legend {
155
+ position: absolute;
156
+ width: 100%;
157
+ height: 100%;
158
+ margin: 0;
159
+ padding: 0;
160
+ border: 0;
161
+ left: 0;
162
+ top: 0;
163
+ opacity: 0;
164
+ pointer-events: none;
165
+ }
166
+
167
+ .clr-segmented label {
168
+ flex-grow: 1;
169
+ margin: 0;
170
+ padding: 4px 0;
171
+ font-size: inherit;
172
+ font-weight: normal;
173
+ line-height: initial;
174
+ text-align: center;
175
+ cursor: pointer;
176
+ }
177
+
178
+ .clr-segmented label:first-of-type {
179
+ border-radius: 10px 0 0 10px;
180
+ }
181
+
182
+ .clr-segmented label:last-of-type {
183
+ border-radius: 0 10px 10px 0;
184
+ }
185
+
186
+ .clr-segmented input:checked + label {
187
+ color: #fff;
188
+ background-color: #666;
189
+ }
190
+
191
+ .clr-swatches {
192
+ order: 2;
193
+ width: calc(100% - 32px);
194
+ margin: 0 16px;
195
+ }
196
+
197
+ .clr-swatches div {
198
+ display: flex;
199
+ flex-wrap: wrap;
200
+ padding-bottom: 12px;
201
+ justify-content: center;
202
+ }
203
+
204
+ .clr-swatches button {
205
+ position: relative;
206
+ width: 20px;
207
+ height: 20px;
208
+ margin: 0 4px 6px 4px;
209
+ padding: 0;
210
+ border: 0;
211
+ border-radius: 50%;
212
+ color: inherit;
213
+ text-indent: -1000px;
214
+ white-space: nowrap;
215
+ overflow: hidden;
216
+ cursor: pointer;
217
+ }
218
+
219
+ .clr-swatches button:after {
220
+ content: '';
221
+ display: block;
222
+ position: absolute;
223
+ width: 100%;
224
+ height: 100%;
225
+ left: 0;
226
+ top: 0;
227
+ border-radius: inherit;
228
+ background-color: currentColor;
229
+ box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
230
+ }
231
+
232
+ input.clr-color {
233
+ order: 1;
234
+ width: calc(100% - 80px);
235
+ height: 32px;
236
+ margin: 15px 20px 20px auto;
237
+ padding: 0 10px;
238
+ border: 1px solid #ddd;
239
+ border-radius: 16px;
240
+ color: #444;
241
+ background-color: #fff;
242
+ font-family: sans-serif;
243
+ font-size: 14px;
244
+ text-align: center;
245
+ box-shadow: none;
246
+ }
247
+
248
+ input.clr-color:focus {
249
+ outline: none;
250
+ border: 1px solid #1e90ff;
251
+ }
252
+
253
+ .clr-close,
254
+ .clr-clear {
255
+ display: none;
256
+ order: 2;
257
+ height: 24px;
258
+ margin: 0 20px 20px;
259
+ padding: 0 20px;
260
+ border: 0;
261
+ border-radius: 12px;
262
+ color: #fff;
263
+ background-color: #666;
264
+ font-family: inherit;
265
+ font-size: 12px;
266
+ font-weight: 400;
267
+ cursor: pointer;
268
+ }
269
+
270
+ .clr-close {
271
+ display: block;
272
+ margin: 0 20px 20px auto;
273
+ }
274
+
275
+ .clr-preview {
276
+ position: relative;
277
+ width: 32px;
278
+ height: 32px;
279
+ margin: 15px 0 20px 20px;
280
+ border-radius: 50%;
281
+ overflow: hidden;
282
+ }
283
+
284
+ .clr-preview:before,
285
+ .clr-preview:after {
286
+ content: '';
287
+ position: absolute;
288
+ height: 100%;
289
+ width: 100%;
290
+ left: 0;
291
+ top: 0;
292
+ border: 1px solid #fff;
293
+ border-radius: 50%;
294
+ }
295
+
296
+ .clr-preview:after {
297
+ border: 0;
298
+ background-color: currentColor;
299
+ box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
300
+ }
301
+
302
+ .clr-preview button {
303
+ position: absolute;
304
+ width: 100%;
305
+ height: 100%;
306
+ z-index: 1;
307
+ margin: 0;
308
+ padding: 0;
309
+ border: 0;
310
+ border-radius: 50%;
311
+ outline-offset: -2px;
312
+ background-color: transparent;
313
+ text-indent: -9999px;
314
+ cursor: pointer;
315
+ overflow: hidden;
316
+ }
317
+
318
+ .clr-marker,
319
+ .clr-hue div,
320
+ .clr-alpha div,
321
+ .clr-color {
322
+ box-sizing: border-box;
323
+ }
324
+
325
+ .clr-field {
326
+ display: inline-block;
327
+ position: relative;
328
+ color: transparent;
329
+ }
330
+
331
+ .clr-field input {
332
+ margin: 0;
333
+ direction: ltr;
334
+ }
335
+
336
+ .clr-field.clr-rtl input {
337
+ text-align: right;
338
+ }
339
+
340
+ .clr-field button {
341
+ position: absolute;
342
+ width: 30px;
343
+ height: 100%;
344
+ right: 0;
345
+ top: 50%;
346
+ transform: translateY(-50%);
347
+ margin: 0;
348
+ padding: 0;
349
+ border: 0;
350
+ color: inherit;
351
+ text-indent: -1000px;
352
+ white-space: nowrap;
353
+ overflow: hidden;
354
+ pointer-events: none;
355
+ }
356
+
357
+ .clr-field.clr-rtl button {
358
+ right: auto;
359
+ left: 0;
360
+ }
361
+
362
+ .clr-field button:after {
363
+ content: '';
364
+ display: block;
365
+ position: absolute;
366
+ width: 100%;
367
+ height: 100%;
368
+ left: 0;
369
+ top: 0;
370
+ border-radius: inherit;
371
+ background-color: currentColor;
372
+ box-shadow: inset 0 0 1px rgba(0,0,0,.5);
373
+ }
374
+
375
+ .clr-alpha,
376
+ .clr-alpha div,
377
+ .clr-swatches button,
378
+ .clr-preview:before,
379
+ .clr-field button {
380
+ background-image: repeating-linear-gradient(45deg, #aaa 25%, transparent 25%, transparent 75%, #aaa 75%, #aaa), repeating-linear-gradient(45deg, #aaa 25%, #fff 25%, #fff 75%, #aaa 75%, #aaa);
381
+ background-position: 0 0, 4px 4px;
382
+ background-size: 8px 8px;
383
+ }
384
+
385
+ .clr-marker:focus {
386
+ outline: none;
387
+ }
388
+
389
+ .clr-keyboard-nav .clr-marker:focus,
390
+ .clr-keyboard-nav .clr-hue input:focus + div,
391
+ .clr-keyboard-nav .clr-alpha input:focus + div,
392
+ .clr-keyboard-nav .clr-segmented input:focus + label {
393
+ outline: none;
394
+ box-shadow: 0 0 0 2px #1e90ff, 0 0 2px 2px #fff;
395
+ }
396
+
397
+ .clr-picker[data-alpha="false"] .clr-alpha {
398
+ display: none;
399
+ }
400
+
401
+ .clr-picker[data-minimal="true"] {
402
+ padding-top: 16px;
403
+ }
404
+
405
+ .clr-picker[data-minimal="true"] .clr-gradient,
406
+ .clr-picker[data-minimal="true"] .clr-hue,
407
+ .clr-picker[data-minimal="true"] .clr-alpha,
408
+ .clr-picker[data-minimal="true"] .clr-color,
409
+ .clr-picker[data-minimal="true"] .clr-preview {
410
+ display: none;
411
+ }
412
+
413
+ /** Dark theme **/
414
+
415
+ .clr-dark {
416
+ background-color: #444;
417
+ }
418
+
419
+ .clr-dark .clr-segmented {
420
+ border-color: #777;
421
+ }
422
+
423
+ .clr-dark .clr-swatches button:after {
424
+ box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
425
+ }
426
+
427
+ .clr-dark input.clr-color {
428
+ color: #fff;
429
+ border-color: #777;
430
+ background-color: #555;
431
+ }
432
+
433
+ .clr-dark input.clr-color:focus {
434
+ border-color: #1e90ff;
435
+ }
436
+
437
+ .clr-dark .clr-preview:after {
438
+ box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
439
+ }
440
+
441
+ .clr-dark .clr-alpha,
442
+ .clr-dark .clr-alpha div,
443
+ .clr-dark .clr-swatches button,
444
+ .clr-dark .clr-preview:before {
445
+ background-image: repeating-linear-gradient(45deg, #666 25%, transparent 25%, transparent 75%, #888 75%, #888), repeating-linear-gradient(45deg, #888 25%, #444 25%, #444 75%, #888 75%, #888);
446
+ }
447
+
448
+ /** Polaroid theme **/
449
+
450
+ .clr-picker.clr-polaroid {
451
+ border-radius: 6px;
452
+ box-shadow: 0 0 5px rgba(0,0,0,.1), 0 5px 30px rgba(0,0,0,.2);
453
+ }
454
+
455
+ .clr-picker.clr-polaroid:before {
456
+ content: '';
457
+ display: block;
458
+ position: absolute;
459
+ width: 16px;
460
+ height: 10px;
461
+ left: 20px;
462
+ top: -10px;
463
+ border: solid transparent;
464
+ border-width: 0 8px 10px 8px;
465
+ border-bottom-color: currentColor;
466
+ box-sizing: border-box;
467
+ color: #fff;
468
+ filter: drop-shadow(0 -4px 3px rgba(0,0,0,.1));
469
+ pointer-events: none;
470
+ }
471
+
472
+ .clr-picker.clr-polaroid.clr-dark:before {
473
+ color: #444;
474
+ }
475
+
476
+ .clr-picker.clr-polaroid.clr-left:before {
477
+ left: auto;
478
+ right: 20px;
479
+ }
480
+
481
+ .clr-picker.clr-polaroid.clr-top:before {
482
+ top: auto;
483
+ bottom: -10px;
484
+ transform: rotateZ(180deg);
485
+ }
486
+
487
+ .clr-polaroid .clr-gradient {
488
+ width: calc(100% - 20px);
489
+ height: 120px;
490
+ margin: 10px;
491
+ border-radius: 3px;
492
+ }
493
+
494
+ .clr-polaroid .clr-hue,
495
+ .clr-polaroid .clr-alpha {
496
+ width: calc(100% - 30px);
497
+ height: 10px;
498
+ margin: 6px 15px;
499
+ border-radius: 5px;
500
+ }
501
+
502
+ .clr-polaroid .clr-hue div,
503
+ .clr-polaroid .clr-alpha div {
504
+ box-shadow: 0 0 5px rgba(0,0,0,.2);
505
+ }
506
+
507
+ .clr-polaroid .clr-format {
508
+ width: calc(100% - 20px);
509
+ margin: 0 10px 15px;
510
+ }
511
+
512
+ .clr-polaroid .clr-swatches {
513
+ width: calc(100% - 12px);
514
+ margin: 0 6px;
515
+ }
516
+ .clr-polaroid .clr-swatches div {
517
+ padding-bottom: 10px;
518
+ }
519
+
520
+ .clr-polaroid .clr-swatches button {
521
+ width: 22px;
522
+ height: 22px;
523
+ }
524
+
525
+ .clr-polaroid input.clr-color {
526
+ width: calc(100% - 60px);
527
+ margin: 10px 10px 15px auto;
528
+ }
529
+
530
+ .clr-polaroid .clr-clear {
531
+ margin: 0 10px 15px 10px;
532
+ }
533
+
534
+ .clr-polaroid .clr-close {
535
+ margin: 0 10px 15px auto;
536
+ }
537
+
538
+ .clr-polaroid .clr-preview {
539
+ margin: 10px 0 15px 10px;
540
+ }
541
+
542
+ /** Large theme **/
543
+
544
+ .clr-picker.clr-large {
545
+ width: 275px;
546
+ }
547
+
548
+ .clr-large .clr-gradient {
549
+ height: 150px;
550
+ }
551
+
552
+ .clr-large .clr-swatches button {
553
+ width: 22px;
554
+ height: 22px;
555
+ }
556
+
557
+ /** Pill (horizontal) theme **/
558
+
559
+ .clr-picker.clr-pill {
560
+ width: 380px;
561
+ padding-left: 180px;
562
+ box-sizing: border-box;
563
+ }
564
+
565
+ .clr-pill .clr-gradient {
566
+ position: absolute;
567
+ width: 180px;
568
+ height: 100%;
569
+ left: 0;
570
+ top: 0;
571
+ margin-bottom: 0;
572
+ border-radius: 3px 0 0 3px;
573
+ }
574
+
575
+ .clr-pill .clr-hue {
576
+ margin-top: 20px;
577
+ }