b4um_generators 0.1.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.
Files changed (87) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +28 -0
  4. data/CHANGELOG.md +5 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.de.md +821 -0
  7. data/README.md +815 -0
  8. data/Rakefile +12 -0
  9. data/b4um_generators.gemspec +30 -0
  10. data/bin/console +11 -0
  11. data/bin/setup +8 -0
  12. data/lib/b4um_generators/version.rb +5 -0
  13. data/lib/b4um_generators.rb +8 -0
  14. data/lib/generators/b4um/bento/bento_generator.rb +81 -0
  15. data/lib/generators/b4um/bento/templates/_alternating.html.erb.tt +15 -0
  16. data/lib/generators/b4um/bento/templates/_bento.html.erb.tt +26 -0
  17. data/lib/generators/b4um/bento/templates/_grid.html.erb.tt +13 -0
  18. data/lib/generators/b4um/bento/templates/_list.html.erb.tt +15 -0
  19. data/lib/generators/b4um/comments/comments_generator.rb +259 -0
  20. data/lib/generators/b4um/comments/templates/_comments.html.erb.tt +63 -0
  21. data/lib/generators/b4um/comments/templates/comment.rb.tt +5 -0
  22. data/lib/generators/b4um/comments/templates/comments_controller.rb.tt +45 -0
  23. data/lib/generators/b4um/comments/templates/create_comments.rb.tt +14 -0
  24. data/lib/generators/b4um/controller/controller_generator.rb +397 -0
  25. data/lib/generators/b4um/help/help_generator.rb +755 -0
  26. data/lib/generators/b4um/infinite_scroll/infinite_scroll_generator.rb +199 -0
  27. data/lib/generators/b4um/infinite_scroll/templates/infinite_scroll_controller.js +61 -0
  28. data/lib/generators/b4um/install/install_generator.rb +492 -0
  29. data/lib/generators/b4um/install/templates/_cookie_consent.html.erb +27 -0
  30. data/lib/generators/b4um/install/templates/_footer.html.erb +17 -0
  31. data/lib/generators/b4um/install/templates/_hero.html.erb +33 -0
  32. data/lib/generators/b4um/install/templates/_navigation.html.erb +31 -0
  33. data/lib/generators/b4um/install/templates/_sitemap.html.erb +48 -0
  34. data/lib/generators/b4um/install/templates/_theme_switcher.html.erb +57 -0
  35. data/lib/generators/b4um/install/templates/b4um/badges.css +43 -0
  36. data/lib/generators/b4um/install/templates/b4um/base.css +42 -0
  37. data/lib/generators/b4um/install/templates/b4um/callouts.css +58 -0
  38. data/lib/generators/b4um/install/templates/b4um/cards.css +401 -0
  39. data/lib/generators/b4um/install/templates/b4um/comments.css +52 -0
  40. data/lib/generators/b4um/install/templates/b4um/cookie-consent.css +83 -0
  41. data/lib/generators/b4um/install/templates/b4um/empty-state.css +26 -0
  42. data/lib/generators/b4um/install/templates/b4um/flash.css +86 -0
  43. data/lib/generators/b4um/install/templates/b4um/footer.css +338 -0
  44. data/lib/generators/b4um/install/templates/b4um/forms.css +924 -0
  45. data/lib/generators/b4um/install/templates/b4um/hero.css +149 -0
  46. data/lib/generators/b4um/install/templates/b4um/layout.css +166 -0
  47. data/lib/generators/b4um/install/templates/b4um/lightbox.css +268 -0
  48. data/lib/generators/b4um/install/templates/b4um/navigation.css +257 -0
  49. data/lib/generators/b4um/install/templates/b4um/pagination.css +85 -0
  50. data/lib/generators/b4um/install/templates/b4um/resources.css +121 -0
  51. data/lib/generators/b4um/install/templates/b4um/search.css +41 -0
  52. data/lib/generators/b4um/install/templates/b4um/tables.css +67 -0
  53. data/lib/generators/b4um/install/templates/b4um/theme-switcher.css +178 -0
  54. data/lib/generators/b4um/install/templates/b4um/theme.css +132 -0
  55. data/lib/generators/b4um/install/templates/b4um.css +20 -0
  56. data/lib/generators/b4um/install/templates/b4um.yml +12 -0
  57. data/lib/generators/b4um/install/templates/b4um_helper.rb +27 -0
  58. data/lib/generators/b4um/install/templates/cookie_consent_controller.js +76 -0
  59. data/lib/generators/b4um/install/templates/dismissible_controller.js +7 -0
  60. data/lib/generators/b4um/install/templates/image_lightbox_controller.js +414 -0
  61. data/lib/generators/b4um/install/templates/image_preview_controller.js +85 -0
  62. data/lib/generators/b4um/install/templates/navigation_controller.js +25 -0
  63. data/lib/generators/b4um/install/templates/navigation_helper.rb +26 -0
  64. data/lib/generators/b4um/install/templates/sitemap_controller.js +35 -0
  65. data/lib/generators/b4um/install/templates/theme_controller.js +122 -0
  66. data/lib/generators/b4um/pagination/pagination_generator.rb +179 -0
  67. data/lib/generators/b4um/pagination/templates/_pagination.html.erb.tt +48 -0
  68. data/lib/generators/b4um/pagination/templates/pagination.rb +36 -0
  69. data/lib/generators/b4um/scaffold/scaffold_generator.rb +333 -0
  70. data/lib/generators/b4um/scaffold/templates/_bento.html.erb.tt +26 -0
  71. data/lib/generators/b4um/scaffold/templates/_form.html.erb.tt +218 -0
  72. data/lib/generators/b4um/scaffold/templates/_resource.html.erb.tt +144 -0
  73. data/lib/generators/b4um/scaffold/templates/_table.html.erb.tt +40 -0
  74. data/lib/generators/b4um/scaffold/templates/edit.html.erb.tt +21 -0
  75. data/lib/generators/b4um/scaffold/templates/index.html.erb.tt +24 -0
  76. data/lib/generators/b4um/scaffold/templates/new.html.erb.tt +17 -0
  77. data/lib/generators/b4um/scaffold/templates/show.html.erb.tt +31 -0
  78. data/lib/generators/b4um/search/search_generator.rb +165 -0
  79. data/lib/generators/b4um/search/templates/search.rb +34 -0
  80. data/lib/generators/b4um/search/templates/search_form.html.erb.tt +15 -0
  81. data/lib/generators/b4um/table/table_generator.rb +63 -0
  82. data/lib/generators/b4um/table/templates/_table.html.erb.tt +40 -0
  83. data/lib/generators/b4um/trix/templates/b4um_rich_text_helper.rb +58 -0
  84. data/lib/generators/b4um/trix/templates/b4um_trix.js +551 -0
  85. data/lib/generators/b4um/trix/trix_generator.rb +383 -0
  86. data/sig/b4um_generators.rbs +4 -0
  87. metadata +148 -0
@@ -0,0 +1,924 @@
1
+ /* -------------------------------------------------------
2
+ Forms
3
+ ------------------------------------------------------- */
4
+
5
+ .form {
6
+ width: 100%;
7
+ }
8
+
9
+ .form-field {
10
+ position: relative;
11
+
12
+ width: 100%;
13
+
14
+ margin: 18px 0;
15
+ }
16
+
17
+ .form-label {
18
+ position: absolute;
19
+ top: 50%;
20
+ left: 14px;
21
+ z-index: 1;
22
+
23
+ padding: 0 5px;
24
+
25
+ background-color: var(--b4um-surface);
26
+ color: var(--b4um-text-muted);
27
+
28
+ line-height: 1;
29
+ pointer-events: none;
30
+
31
+ transform: translateY(-50%);
32
+ transform-origin: left center;
33
+
34
+ transition:
35
+ top 0.18s ease,
36
+ transform 0.18s ease,
37
+ color 0.18s ease;
38
+ }
39
+
40
+ .form-input,
41
+ .form-textarea {
42
+ width: 100%;
43
+ margin: 0;
44
+ padding: 1rem 1.15rem;
45
+
46
+ box-sizing: border-box;
47
+
48
+ border: 1px solid var(--b4um-border);
49
+ border-radius: 8px;
50
+
51
+ background-color: var(--b4um-surface);
52
+ color: var(--b4um-text);
53
+
54
+ font: inherit;
55
+
56
+ outline: none;
57
+
58
+ transition:
59
+ border-color 0.18s ease,
60
+ box-shadow 0.18s ease,
61
+ background-color 0.18s ease;
62
+ }
63
+
64
+ .form-input:hover,
65
+ .form-textarea:hover {
66
+ border-color: var(--b4um-border-hover);
67
+ }
68
+
69
+ .form-input:focus,
70
+ .form-textarea:focus {
71
+ border-color: var(--b4um-primary);
72
+ box-shadow: 0 0 0 3px var(--b4um-primary-soft);
73
+ }
74
+
75
+ .form-field:not(.form-field--checkbox):focus-within .form-label,
76
+ .form-input:not(:placeholder-shown) + .form-label {
77
+ top: 0;
78
+
79
+ color: var(--b4um-primary);
80
+
81
+ transform: translateY(-50%) scale(0.82);
82
+ }
83
+
84
+ /* -------------------------------------------------------
85
+ Textareas
86
+ ------------------------------------------------------- */
87
+
88
+ .form-textarea {
89
+ min-height: 10rem;
90
+ padding-top: 1.15rem;
91
+
92
+ resize: vertical;
93
+ }
94
+
95
+ .form-field--textarea .form-label {
96
+ top: 1.25rem;
97
+
98
+ transform: none;
99
+ }
100
+
101
+ .form-field--textarea:focus-within .form-label,
102
+ .form-field--textarea .form-textarea:not(:placeholder-shown) + .form-label {
103
+ top: 0;
104
+
105
+ color: var(--b4um-primary);
106
+
107
+ transform: translateY(-50%) scale(0.82);
108
+ }
109
+
110
+ /* -------------------------------------------------------
111
+ File uploads
112
+ ------------------------------------------------------- */
113
+
114
+ .form-field--file {
115
+ display: flex;
116
+ flex-direction: column;
117
+ align-items: stretch;
118
+ /*align-items: center;*/
119
+ gap: 1rem;
120
+
121
+ width: 100%;
122
+ padding: 12px 14px;
123
+ box-sizing: border-box;
124
+
125
+ border: 1px solid var(--b4um-border);
126
+ border-radius: 8px;
127
+
128
+ background-color: var(--b4um-surface);
129
+
130
+ transition:
131
+ border-color 0.18s ease,
132
+ box-shadow 0.18s ease;
133
+ }
134
+
135
+ .form-field--file:hover {
136
+ border-color: var(--b4um-border-hover);
137
+ }
138
+
139
+ .form-field--file:focus-within {
140
+ border-color: var(--b4um-primary);
141
+ box-shadow: 0 0 0 3px var(--b4um-primary-soft);
142
+ }
143
+
144
+ .form-file-label {
145
+ flex: 0 0 auto;
146
+
147
+ color: var(--b4um-text-secondary);
148
+ font-weight: 500;
149
+ }
150
+
151
+ .form-file-input {
152
+ min-width: 0;
153
+
154
+ color: var(--b4um-text-muted);
155
+ font: inherit;
156
+ }
157
+
158
+ .form-file-input::file-selector-button {
159
+ margin-right: 12px;
160
+ padding: 0.65rem 1rem;
161
+
162
+ border: 1px solid var(--b4um-primary);
163
+ border-radius: 7px;
164
+
165
+ background-color: var(--b4um-surface);
166
+ color: var(--b4um-primary);
167
+
168
+ font: inherit;
169
+ font-weight: 500;
170
+
171
+ cursor: pointer;
172
+
173
+ transition:
174
+ background-color 0.18s ease,
175
+ border-color 0.18s ease,
176
+ color 0.18s ease,
177
+ box-shadow 0.18s ease;
178
+ }
179
+
180
+ .form-file-input::file-selector-button:hover {
181
+ background-color: var(--b4um-surface-soft);
182
+ border-color: var(--b4um-primary-hover);
183
+ color: var(--b4um-primary-hover);
184
+
185
+ box-shadow: 0 3px 10px var(--b4um-primary-shadow-soft);
186
+ }
187
+
188
+ .form-file-control {
189
+ display: flex;
190
+ align-items: center;
191
+ gap: 0.75rem;
192
+
193
+ width: 100%;
194
+ }
195
+
196
+ .form-image-preview {
197
+ margin-top: 12px;
198
+ }
199
+
200
+ .form-image-preview[hidden] {
201
+ display: none;
202
+ }
203
+
204
+ .form-image-preview--multiple {
205
+ display: flex;
206
+ flex-wrap: wrap;
207
+ gap: 10px;
208
+ }
209
+
210
+ .form-image-preview__image {
211
+ display: block;
212
+
213
+ width: 120px;
214
+ height: 90px;
215
+
216
+ border: 1px solid var(--b4um-border-light);
217
+ border-radius: 8px;
218
+
219
+ object-fit: contain;
220
+ }
221
+
222
+ .form-image-preview__item {
223
+ position: relative;
224
+
225
+ width: 120px;
226
+ height: 90px;
227
+
228
+ border-radius: 8px;
229
+
230
+ cursor: pointer;
231
+
232
+ transition:
233
+ opacity 0.18s ease,
234
+ transform 0.18s ease;
235
+ }
236
+
237
+ .form-image-preview__item .form-image-preview__image {
238
+ width: 100%;
239
+ height: 100%;
240
+ }
241
+
242
+ .form-image-preview__remove-checkbox {
243
+ position: absolute;
244
+
245
+ width: 1px;
246
+ height: 1px;
247
+
248
+ opacity: 0;
249
+ pointer-events: none;
250
+ }
251
+
252
+ .form-image-preview__remove-status {
253
+ position: absolute;
254
+ inset: auto 5px 5px;
255
+
256
+ display: none;
257
+
258
+ padding: 4px 6px;
259
+
260
+ border-radius: 5px;
261
+
262
+ background-color: var(--b4um-danger);
263
+ color: var(--b4um-text-on-primary);
264
+
265
+ font-size: 0.7rem;
266
+ font-weight: 600;
267
+ text-align: center;
268
+ }
269
+
270
+ .form-image-preview__item--removed .form-image-preview__image {
271
+ opacity: 0.28;
272
+ }
273
+
274
+ .form-image-preview__item--removed .form-image-preview__remove-status {
275
+ display: block;
276
+ }
277
+
278
+ /* -------------------------------------------------------
279
+ Checkboxes
280
+ ------------------------------------------------------- */
281
+
282
+ .form-field--checkbox {
283
+ display: flex;
284
+ align-items: center;
285
+ gap: 0.65rem;
286
+
287
+ min-height: 32px;
288
+ margin: 18px 0;
289
+ }
290
+
291
+ .form-checkbox {
292
+ appearance: none;
293
+ -webkit-appearance: none;
294
+
295
+ width: 18px;
296
+ height: 18px;
297
+ margin: 0;
298
+
299
+ flex: 0 0 18px;
300
+
301
+ border: 1px solid var(--b4um-border-checkbox);
302
+ border-radius: 5px;
303
+
304
+ background-color: var(--b4um-surface);
305
+
306
+ cursor: pointer;
307
+
308
+ transition:
309
+ background-color 0.18s ease,
310
+ border-color 0.18s ease,
311
+ box-shadow 0.18s ease,
312
+ transform 0.12s ease;
313
+ }
314
+
315
+ .form-checkbox:hover {
316
+ border-color: var(--b4um-primary);
317
+ }
318
+
319
+ .form-checkbox:checked {
320
+ border-color: var(--b4um-primary);
321
+ background-color: var(--b4um-primary);
322
+
323
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5 6.5 12 13 4.5'/%3E%3C/svg%3E");
324
+
325
+ background-position: center;
326
+ background-repeat: no-repeat;
327
+ background-size: 13px 13px;
328
+ }
329
+
330
+ .form-checkbox:focus-visible {
331
+ outline: none;
332
+
333
+ border-color: var(--b4um-primary);
334
+
335
+ box-shadow: 0 0 0 3px var(--b4um-primary-soft);
336
+ }
337
+
338
+ .form-checkbox:active {
339
+ transform: scale(0.94);
340
+ }
341
+
342
+ .form-label--checkbox {
343
+ position: static;
344
+
345
+ display: inline;
346
+ padding: 0;
347
+
348
+ background: none;
349
+ color: var(--b4um-text-checkbox);
350
+
351
+ line-height: 1.4;
352
+
353
+ transform: none;
354
+
355
+ pointer-events: auto;
356
+ cursor: pointer;
357
+ }
358
+
359
+ /* -------------------------------------------------------
360
+ Form actions
361
+ ------------------------------------------------------- */
362
+
363
+ .form-actions {
364
+ margin: 20px 0 10px;
365
+ }
366
+
367
+ /* -------------------------------------------------------
368
+ Validation errors
369
+ ------------------------------------------------------- */
370
+
371
+ .error-messages {
372
+ width: 100%;
373
+ box-sizing: border-box;
374
+
375
+ margin-bottom: 20px;
376
+ padding: 0 0 12px;
377
+
378
+ border: 2px solid var(--b4um-danger-border);
379
+
380
+ background-color: var(--b4um-neutral-background);
381
+
382
+ font-size: 12px;
383
+ }
384
+
385
+ .error-messages h2 {
386
+ margin: 0;
387
+ padding: 5px 10px;
388
+
389
+ background-color: var(--b4um-danger);
390
+ color: var(--b4um-text-on-primary);
391
+
392
+ font-size: 12px;
393
+ font-weight: bold;
394
+ text-align: left;
395
+ }
396
+
397
+ .error-messages p {
398
+ margin: 8px 10px;
399
+ }
400
+
401
+ .error-messages ul {
402
+ margin: 0;
403
+ padding-left: 30px;
404
+ }
405
+
406
+ .error-messages li {
407
+ margin: 5px 0;
408
+ }
409
+
410
+ .field_with_errors {
411
+ display: contents;
412
+ }
413
+
414
+ /* -------------------------------------------------------
415
+ Rich Text
416
+ ------------------------------------------------------- */
417
+
418
+ .form-field--rich-text {
419
+ display: grid;
420
+ grid-template-columns: 1fr;
421
+ }
422
+
423
+ .form-field--rich-text trix-toolbar {
424
+ grid-row: 1;
425
+
426
+ position: sticky;
427
+ top: 61px;
428
+ z-index: 10;
429
+
430
+ padding: 12px 0 4px;
431
+ margin: -4px 0 12px;
432
+
433
+ background-color: var(--b4um-surface);
434
+ box-shadow: 0 2px 6px var(--b4um-primary-shadow-soft);
435
+ }
436
+
437
+ .form-field--rich-text trix-toolbar .trix-button-group {
438
+ border-color: var(--b4um-border);
439
+ }
440
+
441
+ .form-field--rich-text trix-toolbar .trix-button {
442
+ border-color: var(--b4um-border);
443
+ background-color: var(--b4um-surface);
444
+ color: var(--b4um-text-secondary);
445
+ }
446
+
447
+ /* Trix liefert seine Standard-Icons als schwarze SVGs aus.
448
+ Im dunklen Theme werden sie deshalb aufgehellt. */
449
+ .form-field--rich-text trix-toolbar .trix-button--icon::before {
450
+ filter: none;
451
+ }
452
+
453
+ [data-b4um-theme='dark'] .form-field--rich-text trix-toolbar .trix-button--icon::before {
454
+ filter: invert(1);
455
+ }
456
+
457
+ .form-field--rich-text trix-toolbar .trix-button:not([data-trix-attribute^='bgColor']):hover {
458
+ background-color: var(--b4um-surface-soft);
459
+ }
460
+
461
+ .form-field--rich-text trix-toolbar .trix-button.trix-active:not([data-trix-attribute^='bgColor']) {
462
+ background-color: var(--b4um-primary-soft);
463
+ }
464
+
465
+ .form-field--rich-text trix-toolbar .trix-dialog {
466
+ border-color: var(--b4um-border);
467
+ background-color: var(--b4um-surface);
468
+ color: var(--b4um-text);
469
+ box-shadow: 0 4px 14px var(--b4um-primary-shadow-soft);
470
+ }
471
+
472
+ .form-field--rich-text trix-toolbar .trix-dialog__link-fields {
473
+ background-color: var(--b4um-surface);
474
+ }
475
+
476
+ /* Heading-Auswahl H1–H6 kompakt halten */
477
+ .form-field--rich-text trix-toolbar .trix-dialog--heading {
478
+ width: fit-content;
479
+ max-width: none;
480
+
481
+ margin-left: 185px;
482
+ }
483
+
484
+ .form-field--rich-text trix-toolbar .trix-dialog--heading .trix-dialog__link-fields {
485
+ width: fit-content;
486
+ }
487
+
488
+ .form-field--rich-text trix-toolbar .trix-dialog--heading .trix-button-group {
489
+ width: auto;
490
+ margin: 0;
491
+ }
492
+
493
+ .form-field--rich-text trix-toolbar .trix-input {
494
+ border-color: var(--b4um-border);
495
+ background-color: var(--b4um-surface);
496
+ color: var(--b4um-text);
497
+ }
498
+
499
+ .form-field--rich-text .form-textarea {
500
+ grid-row: 2;
501
+ }
502
+
503
+ .form-field--rich-text .form-label {
504
+ grid-row: 2;
505
+
506
+ top: 0;
507
+
508
+ align-self: start;
509
+
510
+ color: var(--b4um-primary);
511
+
512
+ transform: translateY(-50%) scale(0.82);
513
+ }
514
+ /* -------------------------------------------------------
515
+ Rich Text Attachments
516
+ ------------------------------------------------------- */
517
+
518
+ .form-field--rich-text trix-editor .attachment-gallery {
519
+ display: grid;
520
+ grid-template-columns: repeat(3, minmax(0, 1fr));
521
+ gap: 1em;
522
+ }
523
+
524
+ .form-field--rich-text trix-editor .attachment-gallery--2,
525
+ .form-field--rich-text trix-editor .attachment-gallery--4 {
526
+ grid-template-columns: repeat(2, minmax(0, 1fr));
527
+ }
528
+
529
+ .form-field--rich-text trix-editor .attachment-gallery > .attachment {
530
+ width: 100%;
531
+ max-width: none;
532
+ margin: 0;
533
+ padding: 0;
534
+ box-sizing: border-box;
535
+ }
536
+
537
+ .form-field--rich-text trix-editor .attachment-gallery > [data-trix-cursor-target] {
538
+ position: absolute;
539
+ width: 1px;
540
+ height: 1px;
541
+ overflow: hidden;
542
+ }
543
+
544
+ .form-field--rich-text trix-editor .attachment img {
545
+ display: block;
546
+ width: 100%;
547
+ max-width: 100%;
548
+ height: auto;
549
+
550
+ border-radius: var(--b4um-radius);
551
+ }
552
+
553
+ /* Rich-text videos */
554
+
555
+ .form-field--rich-text trix-editor video,
556
+ .trix-content video,
557
+ .trix-content .b4um-rich-text-video {
558
+ display: block;
559
+
560
+ width: 100%;
561
+ max-width: 100%;
562
+ height: auto;
563
+
564
+ border-radius: var(--b4um-radius);
565
+
566
+ background-color: #000;
567
+ }
568
+
569
+ /* Video attachments stay clearly visible inside the editor. */
570
+
571
+ .form-field--rich-text trix-editor .attachment--mp4 {
572
+ display: block;
573
+
574
+ width: 100%;
575
+ min-height: 70px;
576
+
577
+ margin: 1rem 0;
578
+ padding: 1rem;
579
+
580
+ box-sizing: border-box;
581
+
582
+ border: 1px solid currentColor;
583
+ border-radius: var(--b4um-radius);
584
+
585
+ box-shadow: none;
586
+ }
587
+
588
+ .form-field--rich-text trix-editor .attachment--mp4 .attachment__caption {
589
+ display: block;
590
+
591
+ position: static;
592
+
593
+ width: auto;
594
+ height: auto;
595
+ min-height: 1em;
596
+
597
+ visibility: visible;
598
+ opacity: 1;
599
+
600
+ text-align: left;
601
+ }
602
+
603
+ .form-field--rich-text trix-editor .attachment--mp4 .attachment__caption::before {
604
+ content: '▶';
605
+ display: inline-block;
606
+ margin-right: 0.5em;
607
+ }
608
+
609
+ /* The rendered video does not need the Trix attachment frame or caption. */
610
+
611
+ .trix-content .attachment--mp4 {
612
+ border: 0;
613
+ padding: 0;
614
+ box-shadow: none;
615
+ }
616
+
617
+ .trix-content .attachment--mp4 .attachment__caption {
618
+ display: none;
619
+ }
620
+
621
+ /* -------------------------------------------------------
622
+ Rich Text Content
623
+ ------------------------------------------------------- */
624
+
625
+ /* Code blocks */
626
+
627
+ .form-field--rich-text trix-editor pre,
628
+ .trix-content pre {
629
+ display: block;
630
+
631
+ width: 100%;
632
+ max-width: 100%;
633
+ box-sizing: border-box;
634
+
635
+ margin: 1.25em 0;
636
+ padding: 1em 1.15em;
637
+
638
+ overflow-wrap: anywhere;
639
+ white-space: pre-wrap;
640
+ word-break: normal;
641
+
642
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
643
+ font-size: 0.9em;
644
+ line-height: 1.6;
645
+
646
+ color: var(--b4um-code-text);
647
+ background-color: var(--b4um-code-background);
648
+ border: 1px solid var(--b4um-code-border);
649
+ border-radius: var(--b4um-radius);
650
+ }
651
+
652
+ .trix-content .attachment-gallery {
653
+ display: grid;
654
+ grid-template-columns: repeat(3, minmax(0, 1fr));
655
+ gap: 1em;
656
+
657
+ margin: 1em 0;
658
+ }
659
+
660
+ .trix-content .attachment-gallery--2,
661
+ .trix-content .attachment-gallery--4 {
662
+ grid-template-columns: repeat(2, minmax(0, 1fr));
663
+ }
664
+
665
+ .trix-content .attachment-gallery > action-text-attachment,
666
+ .trix-content .attachment-gallery > .attachment,
667
+ .trix-content .attachment-gallery.attachment-gallery--2 > action-text-attachment,
668
+ .trix-content .attachment-gallery.attachment-gallery--2 > .attachment,
669
+ .trix-content .attachment-gallery.attachment-gallery--4 > action-text-attachment,
670
+ .trix-content .attachment-gallery.attachment-gallery--4 > .attachment {
671
+ width: 100%;
672
+ max-width: none;
673
+ margin: 0;
674
+ padding: 0;
675
+ box-sizing: border-box;
676
+ }
677
+
678
+ .trix-content action-text-attachment img,
679
+ .trix-content .attachment img,
680
+ .trix-content .attachment-gallery img {
681
+ display: block;
682
+ width: 100%;
683
+ max-width: 100%;
684
+ height: auto;
685
+
686
+ border-radius: var(--b4um-radius);
687
+ }
688
+
689
+ .trix-content action-text-attachment[content-type='vnd.rubyonrails.horizontal-rule.html'] {
690
+ display: block;
691
+ width: 100%;
692
+ max-width: none;
693
+ }
694
+
695
+ .trix-content action-text-attachment[content-type='vnd.rubyonrails.horizontal-rule.html'] > figure {
696
+ display: block;
697
+ width: 100%;
698
+ max-width: none;
699
+ }
700
+
701
+ .trix-content .attachment--content.attachment--horizontal-rule,
702
+ .trix-content .attachment--content[data-trix-content-type~='vnd.rubyonrails.horizontal-rule.html'] {
703
+ width: 100%;
704
+ max-width: none;
705
+ padding: 1.5em 0 0.5em;
706
+ margin-bottom: 0.5em;
707
+ }
708
+
709
+ .trix-content .attachment--content.attachment--horizontal-rule hr,
710
+ .trix-content .attachment--content[data-trix-content-type~='vnd.rubyonrails.horizontal-rule.html'] hr {
711
+ display: block;
712
+ width: 100%;
713
+ margin: 0;
714
+ border: 0;
715
+ border-top: 1px solid currentColor;
716
+ }
717
+
718
+ .form-field--rich-text .trix-button--icon-align-left::before {
719
+ background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>');
720
+ }
721
+
722
+ .form-field--rich-text .trix-button--icon-align-center::before {
723
+ background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>');
724
+ }
725
+
726
+ .form-field--rich-text .trix-button--icon-align-right::before {
727
+ background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M6 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-4-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm4-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-4-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>');
728
+ }
729
+
730
+ .form-field--rich-text .trix-button--icon-horizontal-rule::before {
731
+ background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="currentColor"><path d="M0 13h24v-2H0z"/><path d="M5 8.5h14v-3H5z"/><path d="M5 18.5h14v-3H5z"/></g></svg>');
732
+ }
733
+
734
+ .form-field--rich-text .trix-button--icon-color::before {
735
+ background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M12 3a9 9 0 1 0 0 18h1.5a2.5 2.5 0 0 0 0-5H12a1.5 1.5 0 0 1 0-3h3a6 6 0 0 0 0-12h-3Zm-5 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm2-5a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Zm6 1a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Z"/></svg>');
736
+ }
737
+
738
+ .form-field--rich-text .trix-dialog--color {
739
+ max-width: 300px;
740
+ }
741
+
742
+ .form-field--rich-text .trix-dialog--color .trix-dialog__link-fields {
743
+ flex-direction: column;
744
+ align-items: flex-start;
745
+ }
746
+
747
+ .form-field--rich-text .trix-dialog--color .trix-button-group {
748
+ margin: 2px 0;
749
+ }
750
+
751
+ .form-field--rich-text .trix-dialog--color .trix-button {
752
+ width: 28px;
753
+ height: 28px;
754
+ padding: 0;
755
+ }
756
+
757
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute^='fgColor']::after {
758
+ content: 'Ab';
759
+ }
760
+
761
+ .form-field--rich-text .trix-dialog--color .trix-active::after {
762
+ content: '✓';
763
+ }
764
+
765
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='fgColor1'] {
766
+ color: rgb(136, 118, 38);
767
+ }
768
+
769
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='fgColor2'] {
770
+ color: rgb(185, 94, 6);
771
+ }
772
+
773
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='fgColor3'] {
774
+ color: rgb(207, 0, 0);
775
+ }
776
+
777
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='fgColor4'] {
778
+ color: rgb(216, 28, 170);
779
+ }
780
+
781
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='fgColor5'] {
782
+ color: rgb(144, 19, 254);
783
+ }
784
+
785
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='fgColor6'] {
786
+ color: rgb(5, 98, 185);
787
+ }
788
+
789
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='fgColor7'] {
790
+ color: rgb(17, 138, 15);
791
+ }
792
+
793
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='fgColor8'] {
794
+ color: rgb(148, 82, 22);
795
+ }
796
+
797
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='fgColor9'] {
798
+ color: rgb(102, 102, 102);
799
+ }
800
+
801
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='bgColor1'] {
802
+ background-color: rgb(250, 247, 133);
803
+ }
804
+
805
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='bgColor2'] {
806
+ background-color: rgb(255, 240, 219);
807
+ }
808
+
809
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='bgColor3'] {
810
+ background-color: rgb(255, 229, 229);
811
+ }
812
+
813
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='bgColor4'] {
814
+ background-color: rgb(255, 228, 247);
815
+ }
816
+
817
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='bgColor5'] {
818
+ background-color: rgb(242, 237, 255);
819
+ }
820
+
821
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='bgColor6'] {
822
+ background-color: rgb(225, 239, 252);
823
+ }
824
+
825
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='bgColor7'] {
826
+ background-color: rgb(228, 248, 226);
827
+ }
828
+
829
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='bgColor8'] {
830
+ background-color: rgb(238, 226, 215);
831
+ }
832
+
833
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute='bgColor9'] {
834
+ background-color: rgb(242, 242, 242);
835
+ }
836
+
837
+ /* -------------------------------------------------------
838
+ Trix color palette states
839
+ ------------------------------------------------------- */
840
+
841
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute^='bgColor']:hover {
842
+ border-color: var(--b4um-primary);
843
+ box-shadow: inset 0 0 0 2px var(--b4um-primary);
844
+ }
845
+
846
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute^='bgColor'].trix-active {
847
+ border-color: var(--b4um-primary);
848
+ box-shadow:
849
+ inset 0 0 0 2px var(--b4um-primary),
850
+ 0 0 0 2px var(--b4um-surface);
851
+ }
852
+
853
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute^='fgColor']:hover,
854
+ .form-field--rich-text .trix-dialog--color [data-trix-attribute^='fgColor'].trix-active {
855
+ background-color: var(--b4um-surface-soft);
856
+ border-color: var(--b4um-primary);
857
+ }
858
+
859
+ /* -------------------------------------------------------
860
+ Trix color palette states
861
+ ------------------------------------------------------- */
862
+
863
+ /* Farbfelder beim Hover nicht mit einem neuen Hintergrund übermalen */
864
+ .form-field--rich-text .trix-dialog--color .trix-button[data-trix-attribute^='fgColor']:hover,
865
+ .form-field--rich-text .trix-dialog--color .trix-button[data-trix-attribute^='bgColor']:hover {
866
+ border-color: var(--b4um-primary);
867
+ box-shadow: inset 0 0 0 1px var(--b4um-primary);
868
+ }
869
+
870
+ /* Schriftfarben: Hintergrund auch bei Hover/aktiv neutral lassen */
871
+ .form-field--rich-text .trix-dialog--color .trix-button[data-trix-attribute^='fgColor']:hover,
872
+ .form-field--rich-text .trix-dialog--color .trix-button[data-trix-attribute^='fgColor'].trix-active {
873
+ background-color: transparent;
874
+ }
875
+
876
+ /* Aktives Häkchen deutlicher */
877
+ .form-field--rich-text .trix-dialog--color .trix-button.trix-active::after {
878
+ font-weight: 800;
879
+ font-size: 0.9rem;
880
+ }
881
+
882
+ /* Schriftfarben: Häkchen übernimmt die jeweilige Schriftfarbe */
883
+ .form-field--rich-text .trix-dialog--color .trix-button[data-trix-attribute^='fgColor'].trix-active::after {
884
+ color: currentColor;
885
+ }
886
+
887
+ /* Hintergrundfarben: Häkchen kontrastreicher darstellen */
888
+ .form-field--rich-text .trix-dialog--color .trix-button[data-trix-attribute^='bgColor'].trix-active::after {
889
+ color: #1f2937;
890
+ text-shadow: 0 0 1px rgba(255, 255, 255, 0.8);
891
+ }
892
+
893
+ /* -------------------------------------------------------
894
+ Trix heading buttons
895
+ ------------------------------------------------------- */
896
+
897
+ .form-field--rich-text trix-toolbar .trix-button[data-trix-attribute^='heading'] {
898
+ color: var(--b4um-text-muted);
899
+ background-color: var(--b4um-surface);
900
+
901
+ opacity: 0.65;
902
+
903
+ transition:
904
+ color 0.15s ease,
905
+ background-color 0.15s ease,
906
+ border-color 0.15s ease,
907
+ opacity 0.15s ease;
908
+ }
909
+
910
+ .form-field--rich-text trix-toolbar .trix-button[data-trix-attribute^='heading']:hover {
911
+ color: var(--b4um-text);
912
+ background-color: var(--b4um-surface-soft);
913
+ border-color: var(--b4um-primary);
914
+
915
+ opacity: 1;
916
+ }
917
+
918
+ .form-field--rich-text trix-toolbar .trix-button[data-trix-attribute^='heading'].trix-active {
919
+ color: var(--b4um-text-on-primary);
920
+ background-color: var(--b4um-primary);
921
+ border-color: var(--b4um-primary);
922
+
923
+ opacity: 1;
924
+ }