b4um_generators 0.2.11 → 0.2.16

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.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -2
  3. data/README.de.md +165 -8
  4. data/README.md +162 -8
  5. data/lib/b4um_generators/version.rb +1 -1
  6. data/lib/generators/b4um/attachment/attachment_generator.rb +83 -23
  7. data/lib/generators/b4um/authentication/authentication_generator.rb +63 -0
  8. data/lib/generators/b4um/bento/bento_generator.rb +24 -0
  9. data/lib/generators/b4um/help/help_generator.rb +148 -11
  10. data/lib/generators/b4um/in_place/in_place_generator.rb +1231 -0
  11. data/lib/generators/b4um/in_place/templates/_flash.html.erb +15 -0
  12. data/lib/generators/b4um/in_place/templates/b4um_in_place_helper.rb +7 -0
  13. data/lib/generators/b4um/in_place/templates/display_attachment.html.erb.tt +154 -0
  14. data/lib/generators/b4um/in_place/templates/display_attachments.html.erb.tt +165 -0
  15. data/lib/generators/b4um/in_place/templates/display_boolean.html.erb.tt +18 -0
  16. data/lib/generators/b4um/in_place/templates/display_number.html.erb.tt +18 -0
  17. data/lib/generators/b4um/in_place/templates/display_radio.html.erb.tt +23 -0
  18. data/lib/generators/b4um/in_place/templates/display_rich_text.html.erb.tt +123 -0
  19. data/lib/generators/b4um/in_place/templates/display_select.html.erb.tt +23 -0
  20. data/lib/generators/b4um/in_place/templates/display_text.html.erb.tt +18 -0
  21. data/lib/generators/b4um/in_place/templates/edit_attachment.html.erb.tt +83 -0
  22. data/lib/generators/b4um/in_place/templates/edit_attachments.html.erb.tt +65 -0
  23. data/lib/generators/b4um/in_place/templates/edit_boolean.html.erb.tt +32 -0
  24. data/lib/generators/b4um/in_place/templates/edit_number.html.erb.tt +26 -0
  25. data/lib/generators/b4um/in_place/templates/edit_radio.html.erb.tt +32 -0
  26. data/lib/generators/b4um/in_place/templates/edit_rich_text.html.erb.tt +25 -0
  27. data/lib/generators/b4um/in_place/templates/edit_select.html.erb.tt +28 -0
  28. data/lib/generators/b4um/in_place/templates/edit_text.html.erb.tt +25 -0
  29. data/lib/generators/b4um/in_place/templates/in_place.css +935 -0
  30. data/lib/generators/b4um/in_place/templates/in_place_controller.js +115 -0
  31. data/lib/generators/b4um/install/install_generator.rb +18 -13
  32. data/lib/generators/b4um/install/templates/_flash.html.erb +15 -0
  33. data/lib/generators/b4um/install/templates/_footer.html.erb +6 -1
  34. data/lib/generators/b4um/install/templates/b4um/forms.css +127 -0
  35. data/lib/generators/b4um/install/templates/b4um/tables.css +49 -0
  36. data/lib/generators/b4um/install/templates/image_lightbox_controller.js +34 -1
  37. data/lib/generators/b4um/install/templates/rich_text_controller.js +22 -0
  38. data/lib/generators/b4um/install/templates/scroll_to_top_controller.js +12 -0
  39. data/lib/generators/b4um/scaffold/scaffold_generator.rb +106 -0
  40. data/lib/generators/b4um/scaffold/templates/_form.html.erb.tt +29 -0
  41. data/lib/generators/b4um/scaffold/templates/_resource.html.erb.tt +35 -0
  42. data/lib/generators/b4um/scaffold/templates/_table.html.erb.tt +31 -0
  43. data/lib/generators/b4um/table/table_generator.rb +187 -5
  44. data/lib/generators/b4um/table/templates/_table.html.erb.tt +286 -0
  45. data/lib/generators/b4um/trix/trix_generator.rb +104 -6
  46. metadata +27 -3
@@ -0,0 +1,935 @@
1
+ /* -------------------------------------------------------
2
+ In-place editing
3
+ ------------------------------------------------------- */
4
+
5
+ .in-place-edit {
6
+ position: relative;
7
+
8
+ display: inline-block;
9
+
10
+ min-width: 1.5rem;
11
+
12
+ border-radius: 5px;
13
+
14
+ cursor: pointer;
15
+
16
+ transition:
17
+ background-color 0.18s ease,
18
+ box-shadow 0.18s ease;
19
+ }
20
+
21
+ .in-place-edit::after {
22
+ content: '';
23
+
24
+ position: absolute;
25
+ top: 50%;
26
+ left: calc(100% + 0.45rem);
27
+
28
+ width: 1rem;
29
+ height: 1rem;
30
+
31
+ opacity: 0;
32
+
33
+ pointer-events: none;
34
+
35
+ transform: translateY(-50%);
36
+
37
+ background-color: currentColor;
38
+
39
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20h9' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M16.5 3.5a2.121 2.121 0 0 1 3 3L8 18l-4 1 1-4Z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
40
+ center / contain no-repeat;
41
+
42
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20h9' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M16.5 3.5a2.121 2.121 0 0 1 3 3L8 18l-4 1 1-4Z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
43
+ center / contain no-repeat;
44
+
45
+ transition: opacity 0.18s ease;
46
+ }
47
+
48
+ .in-place-edit:hover {
49
+ background-color: var(--b4um-primary-soft);
50
+ }
51
+
52
+ .in-place-edit:hover::after,
53
+ .in-place-edit:focus-visible::after {
54
+ opacity: 0.65;
55
+ }
56
+
57
+ .in-place-edit:focus-visible {
58
+ outline: none;
59
+ box-shadow: 0 0 0 3px var(--b4um-primary-soft);
60
+ }
61
+
62
+ /* -------------------------------------------------------
63
+ In-place rich text
64
+ ------------------------------------------------------- */
65
+
66
+ div.in-place-edit {
67
+ display: block;
68
+ }
69
+
70
+ div.in-place-edit::after {
71
+ top: 0.75rem;
72
+ right: 0.75rem;
73
+ left: auto;
74
+
75
+ transform: none;
76
+ }
77
+
78
+ /* -------------------------------------------------------
79
+ In-place forms
80
+ ------------------------------------------------------- */
81
+
82
+ .in-place-form {
83
+ display: inline-flex;
84
+ align-items: center;
85
+
86
+ width: auto;
87
+ min-width: 0;
88
+ margin: 0;
89
+ }
90
+
91
+ .in-place-form .form-field {
92
+ width: auto;
93
+ min-width: 0;
94
+ margin: 0;
95
+ }
96
+
97
+ /* -------------------------------------------------------
98
+ In-place select
99
+ ------------------------------------------------------- */
100
+
101
+ .in-place-select {
102
+ display: flex;
103
+ align-items: center;
104
+ gap: 0.75rem;
105
+
106
+ width: 100%;
107
+ }
108
+
109
+ .in-place-select form {
110
+ display: inline-flex;
111
+ align-items: center;
112
+ }
113
+
114
+ .in-place-select__input {
115
+ min-width: 10rem;
116
+ min-height: 2.5rem;
117
+
118
+ margin: 0;
119
+ padding: 0.5rem 2.5rem 0.5rem 0.85rem;
120
+
121
+ border: 1px solid var(--b4um-border);
122
+ border-radius: 10px;
123
+
124
+ background-color: var(--b4um-surface);
125
+ color: var(--b4um-text);
126
+
127
+ font: inherit;
128
+ font-size: 0.95rem;
129
+ line-height: 1.2;
130
+
131
+ cursor: pointer;
132
+ outline: none;
133
+
134
+ transition:
135
+ border-color 0.18s ease,
136
+ box-shadow 0.18s ease,
137
+ background-color 0.18s ease;
138
+ }
139
+
140
+ .in-place-select__input:hover {
141
+ border-color: var(--b4um-border-hover);
142
+ }
143
+
144
+ .in-place-select__input:focus {
145
+ border-color: var(--b4um-primary);
146
+ box-shadow: 0 0 0 3px var(--b4um-primary-soft);
147
+ }
148
+
149
+ /* -------------------------------------------------------
150
+ In-place checkbox
151
+ ------------------------------------------------------- */
152
+
153
+ .in-place-checkbox {
154
+ display: inline-flex;
155
+ align-items: center;
156
+ gap: 0.6rem;
157
+
158
+ min-height: 1.5rem;
159
+ }
160
+
161
+ .in-place-checkbox .form-checkbox {
162
+ flex: 0 0 18px;
163
+ }
164
+
165
+ .in-place-checkbox__label {
166
+ color: var(--b4um-text);
167
+
168
+ cursor: pointer;
169
+ }
170
+
171
+ .in-place-field {
172
+ align-items: center;
173
+ }
174
+
175
+ /* -------------------------------------------------------
176
+ In-place boolean
177
+ ------------------------------------------------------- */
178
+
179
+ .in-place-boolean {
180
+ display: inline-flex;
181
+ align-items: center;
182
+ gap: 0.65rem;
183
+
184
+ min-height: 1.5rem;
185
+ }
186
+
187
+ .in-place-switch {
188
+ position: relative;
189
+
190
+ appearance: none;
191
+ -webkit-appearance: none;
192
+
193
+ width: 2.5rem;
194
+ height: 1.4rem;
195
+ margin: 0;
196
+
197
+ flex: 0 0 2.5rem;
198
+
199
+ border: 1px solid var(--b4um-border);
200
+ border-radius: 999px;
201
+
202
+ background-color: var(--b4um-surface);
203
+
204
+ cursor: pointer;
205
+ outline: none;
206
+
207
+ transition:
208
+ border-color 0.18s ease,
209
+ background-color 0.18s ease,
210
+ box-shadow 0.18s ease;
211
+ }
212
+
213
+ .in-place-switch::before {
214
+ content: '';
215
+
216
+ position: absolute;
217
+ top: 50%;
218
+ left: 0.2rem;
219
+
220
+ width: 0.9rem;
221
+ height: 0.9rem;
222
+
223
+ border-radius: 50%;
224
+
225
+ background-color: var(--b4um-text-muted);
226
+
227
+ transform: translateY(-50%);
228
+
229
+ transition:
230
+ left 0.18s ease,
231
+ background-color 0.18s ease;
232
+ }
233
+
234
+ .in-place-switch:hover {
235
+ border-color: var(--b4um-primary);
236
+ }
237
+
238
+ .in-place-switch:focus-visible {
239
+ border-color: var(--b4um-primary);
240
+ box-shadow: 0 0 0 3px var(--b4um-primary-soft);
241
+ }
242
+
243
+ .in-place-switch:checked {
244
+ border-color: var(--b4um-primary);
245
+ background-color: var(--b4um-primary);
246
+ }
247
+
248
+ .in-place-switch:checked::before {
249
+ left: 1.3rem;
250
+
251
+ background-color: #fff;
252
+ }
253
+
254
+ .in-place-boolean__label {
255
+ margin: 0;
256
+
257
+ color: var(--b4um-text);
258
+
259
+ line-height: 1.4;
260
+ cursor: pointer;
261
+ }
262
+
263
+ /* -------------------------------------------------------
264
+ In-place file
265
+ ------------------------------------------------------- */
266
+
267
+ .in-place-file {
268
+ display: block;
269
+
270
+ max-width: 100%;
271
+ margin: 0;
272
+
273
+ color: var(--b4um-text);
274
+
275
+ font: inherit;
276
+ font-size: 0.95rem;
277
+
278
+ cursor: pointer;
279
+ }
280
+
281
+ .in-place-file::file-selector-button {
282
+ margin-right: 0.75rem;
283
+ padding: 0.45rem 0.8rem;
284
+
285
+ border: 1px solid var(--b4um-border);
286
+ border-radius: 6px;
287
+
288
+ background-color: var(--b4um-surface);
289
+ color: var(--b4um-text);
290
+
291
+ font: inherit;
292
+
293
+ cursor: pointer;
294
+
295
+ transition:
296
+ border-color 0.18s ease,
297
+ background-color 0.18s ease,
298
+ color 0.18s ease;
299
+ }
300
+
301
+ .in-place-file::file-selector-button:hover {
302
+ border-color: var(--b4um-primary);
303
+
304
+ background-color: var(--b4um-primary-soft);
305
+ }
306
+
307
+ /* -------------------------------------------------------
308
+ In-place image
309
+ ------------------------------------------------------- */
310
+
311
+ .in-place-image-editor {
312
+ position: relative;
313
+
314
+ width: min(480px, 100%);
315
+ margin: 0;
316
+ padding: 0;
317
+
318
+ border-radius: 12px;
319
+
320
+ overflow: hidden;
321
+ }
322
+
323
+ .in-place-image-editor__controls {
324
+ position: absolute;
325
+ right: 1rem;
326
+ bottom: 1rem;
327
+ }
328
+
329
+ .in-place-image-form {
330
+ display: flex;
331
+ align-items: center;
332
+ justify-content: center;
333
+
334
+ margin: 0;
335
+ }
336
+
337
+ .in-place-file-input {
338
+ position: absolute;
339
+
340
+ width: 1px;
341
+ height: 1px;
342
+
343
+ overflow: hidden;
344
+
345
+ opacity: 0;
346
+ pointer-events: none;
347
+ }
348
+
349
+ .in-place-file-button {
350
+ display: inline-flex;
351
+ align-items: center;
352
+ justify-content: center;
353
+ gap: 0.5rem;
354
+
355
+ min-height: 2.5rem;
356
+ margin: 0;
357
+ padding: 0.55rem 0.9rem;
358
+
359
+ border: 1px solid rgba(255, 255, 255, 0.45);
360
+ border-radius: 8px;
361
+
362
+ background-color: var(--b4um-surface);
363
+ color: var(--b4um-text);
364
+
365
+ font: inherit;
366
+ font-size: 0.875rem;
367
+ font-weight: 600;
368
+ line-height: 1;
369
+
370
+ cursor: pointer;
371
+
372
+ box-shadow: 0 3px 12px rgb(0 0 0 / 0.12);
373
+
374
+ transition:
375
+ background-color 0.18s ease,
376
+ border-color 0.18s ease,
377
+ box-shadow 0.18s ease,
378
+ transform 0.18s ease;
379
+ }
380
+
381
+ .in-place-file-button:hover {
382
+ border-color: var(--b4um-primary);
383
+
384
+ background-color: var(--b4um-primary);
385
+ color: var(--b4um-surface);
386
+ }
387
+
388
+ .in-place-file-button:focus-within {
389
+ box-shadow: 0 0 0 3px var(--b4um-primary-soft);
390
+ }
391
+
392
+ .in-place-image-action {
393
+ position: absolute;
394
+ top: 1rem;
395
+ right: 1rem;
396
+ z-index: 2;
397
+
398
+ display: flex;
399
+
400
+ margin: 0;
401
+ }
402
+
403
+ .in-place-image-action__button,
404
+ .in-place-gallery-action__button {
405
+ padding: 0.4rem 0.7rem;
406
+
407
+ border: 1px solid var(--b4um-border);
408
+ border-radius: 6px;
409
+
410
+ background-color: var(--b4um-surface);
411
+ color: var(--b4um-text);
412
+
413
+ font: inherit;
414
+ font-size: 0.9rem;
415
+
416
+ cursor: pointer;
417
+
418
+ transition:
419
+ border-color 0.18s ease,
420
+ background-color 0.18s ease;
421
+ }
422
+
423
+ .in-place-image-action__button:hover,
424
+ .in-place-gallery-action__button:hover {
425
+ border-color: var(--b4um-primary);
426
+
427
+ background-color: var(--b4um-primary-soft);
428
+ }
429
+
430
+ .in-place-image-container {
431
+ position: relative;
432
+
433
+ width: fit-content;
434
+ max-width: 100%;
435
+ }
436
+
437
+ .in-place-image-container--empty {
438
+ display: inline-flex;
439
+ align-items: center;
440
+ gap: 0.75rem;
441
+
442
+ width: auto;
443
+ min-height: 2.5rem;
444
+ padding-right: 3rem;
445
+ }
446
+
447
+ .in-place-image-container--empty .in-place-image-action {
448
+ top: 50%;
449
+ right: 0;
450
+
451
+ transform: translateY(-50%);
452
+ }
453
+
454
+ .in-place-attachment__button {
455
+ display: block;
456
+
457
+ width: auto;
458
+ max-width: 100%;
459
+ padding: 0;
460
+
461
+ border: 0;
462
+
463
+ background: transparent;
464
+
465
+ cursor: zoom-in;
466
+ }
467
+
468
+ .in-place-attachment__image {
469
+ display: block;
470
+
471
+ width: auto;
472
+ max-width: min(480px, 100%);
473
+ height: auto;
474
+
475
+ border-radius: 12px;
476
+ }
477
+
478
+ /* -------------------------------------------------------
479
+ In-place gallery
480
+ ------------------------------------------------------- */
481
+
482
+ .in-place-gallery-form {
483
+ width: 100%;
484
+ margin: 0;
485
+ }
486
+
487
+ .in-place-gallery {
488
+ display: flex;
489
+ flex-wrap: wrap;
490
+ align-items: flex-start;
491
+ gap: 0.75rem;
492
+ }
493
+
494
+ .in-place-gallery__item,
495
+ .in-place-gallery__add {
496
+ position: relative;
497
+
498
+ width: auto;
499
+ height: 130px;
500
+
501
+ flex: 1 1 180px;
502
+ max-width: 240px;
503
+
504
+ border: 0;
505
+ border-radius: 10px;
506
+
507
+ overflow: hidden;
508
+ }
509
+
510
+ .in-place-gallery__image {
511
+ display: block;
512
+
513
+ width: 100%;
514
+ height: 100%;
515
+
516
+ object-fit: contain;
517
+ }
518
+
519
+ .in-place-gallery__remove {
520
+ position: absolute;
521
+
522
+ width: 1px;
523
+ height: 1px;
524
+
525
+ opacity: 0;
526
+ pointer-events: none;
527
+ }
528
+
529
+ .in-place-gallery__remove-button {
530
+ position: absolute;
531
+ top: 0.4rem;
532
+ right: 0.4rem;
533
+
534
+ display: flex;
535
+ align-items: center;
536
+ justify-content: center;
537
+
538
+ width: 1.7rem;
539
+ height: 1.7rem;
540
+
541
+ margin: 0;
542
+ padding: 0;
543
+
544
+ border: 1px solid var(--b4um-border);
545
+ border-radius: 50%;
546
+
547
+ background-color: var(--b4um-surface);
548
+ color: var(--b4um-text);
549
+
550
+ font-size: 1.25rem;
551
+ font-weight: 400;
552
+ line-height: 1;
553
+
554
+ cursor: pointer;
555
+
556
+ box-shadow: 0 2px 8px rgb(0 0 0 / 0.16);
557
+
558
+ transition:
559
+ border-color 0.18s ease,
560
+ background-color 0.18s ease,
561
+ color 0.18s ease,
562
+ transform 0.18s ease;
563
+ }
564
+
565
+ .in-place-gallery__remove-button:hover {
566
+ border-color: var(--b4um-primary);
567
+
568
+ background-color: var(--b4um-primary);
569
+ color: var(--b4um-surface);
570
+
571
+ transform: scale(1.06);
572
+ }
573
+
574
+ .in-place-gallery__file {
575
+ position: absolute;
576
+
577
+ width: 1px;
578
+ height: 1px;
579
+
580
+ overflow: hidden;
581
+
582
+ opacity: 0;
583
+ pointer-events: none;
584
+ }
585
+
586
+ .in-place-gallery__add {
587
+ border: 1px dashed var(--b4um-border);
588
+ background-color: var(--b4um-surface);
589
+
590
+ transition:
591
+ border-color 0.18s ease,
592
+ background-color 0.18s ease;
593
+ }
594
+
595
+ .in-place-gallery__add:hover {
596
+ border-color: var(--b4um-primary);
597
+ }
598
+
599
+ .in-place-gallery__add-button {
600
+ display: flex;
601
+ flex-direction: column;
602
+ align-items: center;
603
+ justify-content: center;
604
+ gap: 0.3rem;
605
+
606
+ width: 100%;
607
+ height: 100%;
608
+
609
+ margin: 0;
610
+ padding: 0.5rem;
611
+
612
+ box-sizing: border-box;
613
+
614
+ color: var(--b4um-text-secondary);
615
+
616
+ font-size: 0.85rem;
617
+ text-align: center;
618
+
619
+ cursor: pointer;
620
+
621
+ transition:
622
+ background-color 0.18s ease,
623
+ color 0.18s ease;
624
+ }
625
+
626
+ .in-place-gallery__add-button:hover {
627
+ background-color: var(--b4um-primary-soft);
628
+ color: var(--b4um-primary);
629
+ }
630
+
631
+ .in-place-gallery__add-icon {
632
+ font-size: 1.75rem;
633
+ font-weight: 300;
634
+ line-height: 1;
635
+ }
636
+
637
+ .in-place-gallery-display {
638
+ display: flex;
639
+ align-items: flex-start;
640
+ gap: 0.75rem;
641
+
642
+ min-width: 0;
643
+ }
644
+
645
+ .in-place-gallery-display .resource-images {
646
+ display: flex;
647
+ flex: 1 1 auto;
648
+ flex-wrap: wrap;
649
+ gap: 0.5rem;
650
+
651
+ min-width: 0;
652
+ }
653
+
654
+ .in-place-gallery-display--compact .resource-images__button {
655
+ width: 100px;
656
+ height: 75px;
657
+
658
+ flex: 0 0 100px;
659
+
660
+ padding: 0;
661
+
662
+ border: 0;
663
+ border-radius: 8px;
664
+
665
+ overflow: hidden;
666
+ }
667
+
668
+ .in-place-gallery-display--full .resource-images__button {
669
+ width: auto;
670
+ height: 130px;
671
+
672
+ flex: 1 1 180px;
673
+ max-width: 240px;
674
+
675
+ padding: 0;
676
+
677
+ border: 0;
678
+ border-radius: 10px;
679
+
680
+ overflow: hidden;
681
+ }
682
+
683
+ .in-place-gallery-display .resource-images__image {
684
+ display: block;
685
+
686
+ width: 100%;
687
+ height: 100%;
688
+
689
+ border: 0;
690
+ border-radius: 8px;
691
+
692
+ object-fit: cover;
693
+ }
694
+
695
+ .in-place-gallery-action {
696
+ display: flex;
697
+ align-items: center;
698
+
699
+ flex: 0 0 auto;
700
+ margin: 0;
701
+ }
702
+ /* -------------------------------------------------------
703
+ In-place edit button
704
+ ------------------------------------------------------- */
705
+
706
+ .in-place-edit-button {
707
+ display: inline-flex;
708
+ align-items: center;
709
+ justify-content: center;
710
+
711
+ width: 2rem;
712
+ height: 2rem;
713
+ padding: 0;
714
+
715
+ border: 1px solid var(--b4um-border);
716
+ border-radius: 50%;
717
+
718
+ background-color: var(--b4um-surface);
719
+ color: var(--b4um-text-secondary);
720
+
721
+ cursor: pointer;
722
+
723
+ transition:
724
+ border-color 0.18s ease,
725
+ background-color 0.18s ease,
726
+ color 0.18s ease,
727
+ transform 0.18s ease;
728
+ }
729
+
730
+ .in-place-edit-button:hover {
731
+ border-color: var(--b4um-primary);
732
+
733
+ background-color: var(--b4um-primary);
734
+ color: var(--b4um-surface);
735
+
736
+ transform: scale(1.05);
737
+ }
738
+
739
+ .in-place-edit-button__icon {
740
+ width: 1rem;
741
+ height: 1rem;
742
+ }
743
+
744
+ /* -------------------------------------------------------
745
+ In-place number / decimal
746
+ ------------------------------------------------------- */
747
+
748
+ .in-place-number {
749
+ width: 8rem;
750
+ margin: 0;
751
+ padding: 0.4rem 0.65rem;
752
+
753
+ border: 1px solid var(--b4um-border);
754
+ border-radius: 6px;
755
+
756
+ background-color: var(--b4um-surface);
757
+ color: var(--b4um-text);
758
+
759
+ font: inherit;
760
+ line-height: 1.2;
761
+
762
+ outline: none;
763
+
764
+ transition:
765
+ border-color 0.18s ease,
766
+ box-shadow 0.18s ease,
767
+ background-color 0.18s ease;
768
+ }
769
+
770
+ .in-place-number:hover {
771
+ border-color: var(--b4um-border-hover);
772
+ }
773
+
774
+ .in-place-number:focus {
775
+ border-color: var(--b4um-primary);
776
+ box-shadow: 0 0 0 3px var(--b4um-primary-soft);
777
+ }
778
+
779
+ .in-place-number__suffix {
780
+ margin-left: 0.35rem;
781
+
782
+ color: var(--b4um-text);
783
+ }
784
+
785
+ /* -------------------------------------------------------
786
+ In-place validation errors
787
+ ------------------------------------------------------- */
788
+
789
+ .in-place-error {
790
+ margin-bottom: 0.5rem;
791
+ color: #dc2626;
792
+ font-size: 0.875rem;
793
+ font-weight: 500;
794
+ }
795
+
796
+ /* -------------------------------------------------------
797
+ Single attachment editor
798
+ ------------------------------------------------------- */
799
+
800
+ .in-place-image-editor__preview {
801
+ position: relative;
802
+ }
803
+
804
+ .in-place-image-editor__image {
805
+ display: block;
806
+
807
+ width: auto;
808
+ max-width: 100%;
809
+ height: auto;
810
+
811
+ border-radius: 12px;
812
+ }
813
+
814
+ .in-place-image-remove {
815
+ position: absolute;
816
+ top: 1rem;
817
+ right: 1rem;
818
+ z-index: 5;
819
+
820
+ display: flex;
821
+ align-items: center;
822
+ justify-content: center;
823
+
824
+ width: 2.5rem;
825
+ height: 2.5rem;
826
+
827
+ border: 0;
828
+ border-radius: 50%;
829
+
830
+ background: rgba(0, 0, 0, 0.72);
831
+ color: #fff;
832
+
833
+ cursor: pointer;
834
+
835
+ transition:
836
+ transform 0.18s ease,
837
+ background-color 0.18s ease;
838
+ }
839
+
840
+ .in-place-image-remove:hover {
841
+ background: rgba(0, 0, 0, 0.9);
842
+ transform: scale(1.06);
843
+ }
844
+
845
+ .in-place-image-remove__input {
846
+ position: absolute;
847
+
848
+ width: 1px;
849
+ height: 1px;
850
+
851
+ opacity: 0;
852
+ pointer-events: none;
853
+ }
854
+
855
+ .in-place-image-remove__icon {
856
+ display: block;
857
+
858
+ font-size: 1.75rem;
859
+ font-weight: 300;
860
+ line-height: 1;
861
+ }
862
+
863
+ .in-place-file-button--replace {
864
+ position: absolute;
865
+ right: 1rem;
866
+ bottom: 1rem;
867
+ z-index: 4;
868
+
869
+ background: rgba(0, 0, 0, 0.68);
870
+ color: #fff;
871
+
872
+ backdrop-filter: blur(8px);
873
+ -webkit-backdrop-filter: blur(8px);
874
+ }
875
+
876
+ .in-place-file-button--replace:hover {
877
+ background: rgba(0, 0, 0, 0.85);
878
+ border-color: rgba(255, 255, 255, 0.7);
879
+ transform: translateY(-1px);
880
+ }
881
+
882
+ .in-place-file-button--choose {
883
+ margin-top: 1rem;
884
+
885
+ border-color: var(--b4um-primary);
886
+
887
+ background: var(--b4um-primary);
888
+ color: #fff;
889
+ }
890
+
891
+ .in-place-file-button--choose:hover {
892
+ transform: translateY(-1px);
893
+ }
894
+
895
+ .in-place-file-button__icon {
896
+ display: inline-flex;
897
+ align-items: center;
898
+ justify-content: center;
899
+
900
+ font-size: 1rem;
901
+ line-height: 1;
902
+ }
903
+
904
+ .in-place-image-editor__empty {
905
+ display: flex;
906
+ align-items: center;
907
+ justify-content: center;
908
+
909
+ min-height: 14rem;
910
+
911
+ border: 2px dashed var(--b4um-border);
912
+ border-radius: 12px;
913
+
914
+ color: var(--b4um-text-muted);
915
+ }
916
+
917
+ /* -------------------------------------------------------
918
+ Rich text display
919
+ ------------------------------------------------------- */
920
+
921
+ .in-place-rich-text {
922
+ position: relative;
923
+ }
924
+
925
+ .in-place-rich-text__content {
926
+ width: 100%;
927
+ }
928
+
929
+ .in-place-rich-text__action {
930
+ position: absolute;
931
+ top: 0;
932
+ right: 0;
933
+
934
+ z-index: 2;
935
+ }