rails_app_generator 0.1.5 → 0.1.6

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: 61584871c27593a475f9266892a00343a4fd98b6388c38b2a80547ff3cd40f1e
4
- data.tar.gz: 681d598b1f1fb9dfd70c5d3618c5037db158acad95d8174d0c4b2bbdad1ae826
3
+ metadata.gz: 74ea402449d28be464f76e50d4f78f0e29905f7b23ab85bdb7c12a1be32337a1
4
+ data.tar.gz: e6543558c80c0c27428ad863b6927ac3d5c39430b828c55feb4d4006a1295bec
5
5
  SHA512:
6
- metadata.gz: 6d08bcff1a077b710c8d9b97889c38bfed782c95acef0711be0f9e778c2abb71d9de56d81ca0b63822e999aa5e3fa30a039f3650690dc863c09f72de0e4d2063
7
- data.tar.gz: 5b7415163f0471157b80735a38d742e75059154c184f0b3a72f05e9ceb7edb9023e1ea11ae5e2c65d9be20e135b70d6d25db46b096631ba2eeab192849ae6fcb
6
+ metadata.gz: 7311f3c9f20f306e775f1c818ef9c0ce47ab0392b4eb54fca421ffcaa023b3b1b62aedd6ee9f320a277f53da14066eb7139ed21d7695bd47a220313e97f78996
7
+ data.tar.gz: dcb71902c885e49d3d6197d47f445edb3db5528cd22f0b700b9c9823a41fdd9b321cd891f9a476672fd6ddc07cd8dff94df5b30e86711fd4bddd1aaf12db36c5
@@ -7,7 +7,6 @@ KManager.action :project_plan do
7
7
  .page('In progress', theme: :style_03, margin_left: 0, margin_top: 0) do
8
8
  grid_layout(y: 90, direction: :horizontal, grid_h: 80, grid_w: 320, wrap_at: 3, grid: 0)
9
9
 
10
- todo(title: 'add profile - rag_tailwind_style_reuse')
11
10
  todo(title: 'add profile - rag_tailwind_hotwire_flash')
12
11
  end
13
12
  .page('To Do', theme: :style_02, margin_left: 0, margin_top: 0) do
@@ -34,10 +33,11 @@ KManager.action :project_plan do
34
33
 
35
34
  grid_layout(y:90, direction: :horizontal, grid_h: 80, grid_w: 320, wrap_at: 3, grid: 0)
36
35
 
37
- todo(title: 'add profile - tailwind_hotwire_form_search')
38
- todo(title: 'add profile - tailwind_hotwire_form')
39
- todo(title: 'add profile - tailwind_hotwire')
40
- todo(title: 'add profile - import_map') # vs esbuild - import_map is a replacement for webpacker
36
+ todo(title: 'add profile - tailwind-emulating-bootstrap')
37
+ todo(title: 'add profile - tailwind-hotwire-form-search')
38
+ todo(title: 'add profile - tailwind-hotwire-form')
39
+ todo(title: 'add profile - tailwind-hotwire')
40
+ todo(title: 'add profile - import-map') # vs esbuild - import_map is a replacement for webpacker
41
41
  todo(title: 'profile - fix the bootstrap profile')
42
42
  todo(title: 'cli support for profile')
43
43
  todo(title: 'separate CLI methods into include modules')
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [0.1.5](https://github.com/klueless-io/rails_app_generator/compare/v0.1.4...v0.1.5) (2022-07-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add profile - tailwind_hotwire_form_search ([2a1622b](https://github.com/klueless-io/rails_app_generator/commit/2a1622bf4bb4f236e08fd2c8bd44ec970a46c75d))
7
+
1
8
  ## [0.1.4](https://github.com/klueless-io/rails_app_generator/compare/v0.1.3...v0.1.4) (2022-07-28)
2
9
 
3
10
 
@@ -4,6 +4,9 @@ A set of templates that can be used via the `--template` argument
4
4
 
5
5
  ## Videos
6
6
 
7
+ - Bootstrap & Tailwind in same application plus Bootstrap Emulation
8
+ - Demonstrates running bootstrap and tailwind in the same Rails 7 application
9
+ - Demonstrates using Bootstrap CSS classes in a Tailwind project
7
10
  - Hotwire Flash Messages
8
11
  - Tailwind, DaisyUI and Theme Changer using Stimulus
9
12
  - Make sure it persists the theme change across pages
@@ -0,0 +1,3 @@
1
+ web: bin/rails server -p 3000
2
+ css_bootstrap: yarn build:css_bootstrap --watch
3
+ css_tailwind: yarn build:css_tailwind --watch
@@ -0,0 +1,20 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>TailwindEmulatingBootstrap</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <%= csrf_meta_tags %>
7
+ <%= csp_meta_tag %>
8
+
9
+ <%= stylesheet_link_tag css_framework, "data-turbo-track": "reload" %>
10
+ <%= javascript_importmap_tags %>
11
+ </head>
12
+
13
+ <body>
14
+ <%= link_to "Bootstrap" , home_bootstrap_path, class: "btn btn-#{File.basename(request.path) == 'bootstrap' ? 'primary' : 'secondary'}" %>
15
+ <%= link_to "Tailwind" , home_tailwind_path , class: "btn btn-#{File.basename(request.path) == 'tailwind' ? 'primary' : 'secondary'}" %>
16
+ <hr />
17
+
18
+ <%= yield %>
19
+ </body>
20
+ </html>
@@ -0,0 +1,514 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ /*
6
+ The components were found here: https://tailwindcss.com/docs/customizing-components/
7
+
8
+ Another useful tool for inferring tailwind classes for components is here: https://usewindy.com/
9
+ */
10
+
11
+ @layer components {
12
+ .h1, h1 {
13
+ @apply text-4xl
14
+ }
15
+
16
+ .h2, h2 {
17
+ @apply text-3xl
18
+ }
19
+
20
+ .h3, h3 {
21
+ @apply text-2xl
22
+ }
23
+
24
+ .h4, h4 {
25
+ @apply text-xl
26
+ }
27
+
28
+ .h5, h5 {
29
+ @apply text-lg
30
+ }
31
+
32
+ .h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
33
+ @apply mb-2 font-medium leading-tight
34
+ }
35
+
36
+ a {
37
+ @apply text-blue-500;
38
+ }
39
+
40
+ a:hover {
41
+ @apply text-blue-800;
42
+ }
43
+
44
+ .text-muted {
45
+ @apply text-gray-600;
46
+ }
47
+
48
+ .bg-dark {
49
+ @apply bg-gray-900;
50
+ }
51
+
52
+ .bg-light {
53
+ @apply bg-gray-200;
54
+ }
55
+
56
+ .close {
57
+ @apply float-right text-2xl font-bold leading-none text-black opacity-50
58
+ }
59
+
60
+ /*
61
+ * ============================
62
+ * Alerts
63
+ *=============================
64
+ */
65
+
66
+ .alert {
67
+ @apply relative px-5 py-3 mb-4 rounded border border-transparent;
68
+ }
69
+
70
+ .alert-primary {
71
+ @apply text-blue-800 bg-blue-200 border-blue-300;
72
+ }
73
+
74
+ .alert-secondary {
75
+ @apply text-gray-800 bg-gray-300 border-gray-400;
76
+ }
77
+
78
+ .alert-success {
79
+ @apply text-green-800 bg-green-200 border-green-300;
80
+ }
81
+
82
+ .alert-danger {
83
+ @apply text-red-800 bg-red-200 border-red-300;
84
+ }
85
+
86
+ .alert-warning {
87
+ @apply text-yellow-800 bg-yellow-200 border-yellow-300;
88
+ }
89
+
90
+ .alert-info {
91
+ @apply text-indigo-800 bg-indigo-200 border-indigo-300;
92
+ }
93
+
94
+ /*
95
+ * ============================
96
+ * Buttons
97
+ *=============================
98
+ */
99
+
100
+ .btn {
101
+ @apply inline-block font-normal text-center px-3 py-2 leading-normal text-base rounded cursor-pointer;
102
+ }
103
+
104
+ .btn-primary {
105
+ @apply text-white bg-blue-600;
106
+ }
107
+
108
+ .btn-primary:hover {
109
+ @apply text-white bg-blue-700
110
+ }
111
+
112
+ .btn-secondary {
113
+ @apply text-white bg-gray-600;
114
+ }
115
+
116
+ .btn-secondary:hover {
117
+ @apply text-white bg-gray-700
118
+ }
119
+
120
+ .btn-success {
121
+ @apply text-white bg-green-600;
122
+ }
123
+
124
+ .btn-success:hover {
125
+ @apply text-white bg-green-700
126
+ }
127
+
128
+ .btn-danger {
129
+ @apply text-white bg-red-600;
130
+ }
131
+
132
+ .btn-danger:hover {
133
+ @apply text-white bg-red-700
134
+ }
135
+
136
+ .btn-warning {
137
+ @apply text-black bg-yellow-500;
138
+ }
139
+
140
+ .btn-warning:hover {
141
+ @apply text-black bg-yellow-600
142
+ }
143
+
144
+ .btn-info {
145
+ @apply text-white bg-teal-500;
146
+ }
147
+
148
+ .btn-info:hover {
149
+ @apply text-white bg-teal-600
150
+ }
151
+
152
+ .btn-light {
153
+ @apply text-black bg-gray-200;
154
+ }
155
+
156
+ .btn-light:hover {
157
+ @apply text-black bg-gray-300
158
+ }
159
+
160
+ .btn-dark {
161
+ @apply text-white bg-gray-900;
162
+ }
163
+
164
+ .btn-dark:hover {
165
+ @apply text-white bg-black
166
+ }
167
+
168
+ .btn-link {
169
+ @apply text-blue-500;
170
+ }
171
+
172
+ .btn-link:hover {
173
+ @apply text-blue-800;
174
+ }
175
+
176
+
177
+ /*
178
+ * ============================
179
+ * Cards
180
+ *=============================
181
+ */
182
+
183
+ .card {
184
+ @apply flex flex-col relative bg-white rounded border border-gray-300;
185
+ }
186
+
187
+ .card-body {
188
+ @apply flex-auto p-5;
189
+ }
190
+
191
+ .card-img-top {
192
+ @apply w-full rounded-t;
193
+ }
194
+
195
+ .card-link + .card-link {
196
+ @apply ml-5;
197
+ }
198
+
199
+ .card-text {
200
+ @apply my-0 mb-4;
201
+ }
202
+
203
+ .card-title {
204
+ @apply mb-3 text-xl;
205
+ }
206
+
207
+ /*
208
+ * ============================
209
+ * Dropdowns
210
+ *=============================
211
+ */
212
+
213
+ .dropdown {
214
+ @apply relative;
215
+ }
216
+
217
+ .dropdown-divider {
218
+ @apply h-0 my-2 border-t border-gray-300;
219
+ }
220
+
221
+ .dropdown-menu {
222
+ min-width: 10rem;
223
+ @apply hidden z-20 float-left py-2 mt-1 text-base text-gray-900 list-none text-left border border-gray-300 bg-white rounded shadow;
224
+ }
225
+
226
+ .dropdown-menu.show, .dropdown.open .dropdown-menu {
227
+ @apply block absolute top-0 left-0 mt-12;
228
+ }
229
+
230
+ .dropdown-item {
231
+ @apply block w-full py-1 px-6 font-normal text-gray-900 bg-transparent border-0;
232
+ }
233
+ .dropdown-item:hover {
234
+ @apply text-gray-900 bg-gray-100;
235
+ }
236
+
237
+ .dropdown-toggle::after {
238
+ display: inline-block;
239
+ margin-left: .255em;
240
+ vertical-align: .255em;
241
+ content: "";
242
+ border-top: .3em solid;
243
+ border-right: .3em solid transparent;
244
+ border-bottom: 0;
245
+ border-left: .3em solid transparent;
246
+ }
247
+
248
+ /*
249
+ * ============================
250
+ * Forms
251
+ *=============================
252
+ */
253
+
254
+ form {
255
+ @apply block;
256
+ }
257
+
258
+ label {
259
+ @apply inline-block mb-2;
260
+ }
261
+
262
+ .form-check {
263
+ @apply relative block pl-5;
264
+ }
265
+
266
+ .form-group {
267
+ @apply mb-4;
268
+ }
269
+
270
+ .form-check-input {
271
+ @apply absolute mt-1 -ml-5;
272
+ }
273
+
274
+ .form-check-label {
275
+ @apply mb-0;
276
+ }
277
+
278
+ .form-control {
279
+ @apply block w-full py-2 px-3 text-base font-normal leading-normal text-gray-700 bg-white border border-gray-400 rounded;
280
+ }
281
+
282
+ .form-inline {
283
+ @apply flex flex-wrap flex-row items-center
284
+ }
285
+
286
+ .form-inline .form-control {
287
+ @apply inline-block w-auto align-middle
288
+ }
289
+
290
+ .form-text {
291
+ @apply block mt-1;
292
+ }
293
+
294
+
295
+ /*
296
+ * ============================
297
+ * List Groups
298
+ *=============================
299
+ */
300
+
301
+ .list-group {
302
+ @apply flex flex-col p-0 mb-0;
303
+ }
304
+
305
+ .list-group-item {
306
+ margin-bottom: -1px;
307
+ @apply relative block py-3 px-5 bg-white border border-gray-300;
308
+ }
309
+
310
+ .list-group-item:first-child {
311
+ @apply rounded-t;
312
+ }
313
+
314
+ .list-group-item:last-child {
315
+ @apply mb-0 rounded-b;
316
+ }
317
+
318
+ .list-group-item.disabled, .list-group-item:disabled {
319
+ @apply text-gray-600 bg-white pointer-events-none
320
+ }
321
+
322
+ .list-group-item-action {
323
+ @apply w-full text-gray-900;
324
+ }
325
+
326
+ .list-group-item-action:hover {
327
+ @apply text-gray-900 bg-gray-100;
328
+ }
329
+
330
+ .list-group-item.active {
331
+ @apply text-white bg-blue-600 z-10;
332
+ }
333
+
334
+
335
+ /*
336
+ * ============================
337
+ * Modals
338
+ *=============================
339
+ */
340
+
341
+ .fade {
342
+ transition: opacity .15s linear;
343
+ }
344
+
345
+ .modal {
346
+ z-index: 1072;
347
+ @apply hidden fixed top-0 left-0 w-full h-full outline-none
348
+ }
349
+
350
+ .modal.show, .modal.in {
351
+ @apply block
352
+ }
353
+
354
+ .modal-dialog {
355
+ @apply relative w-auto pointer-events-none max-w-lg my-8 mx-auto
356
+ }
357
+
358
+ .modal-content {
359
+ @apply relative flex flex-col w-full pointer-events-auto bg-white border border-gray-300 rounded-lg
360
+ }
361
+
362
+ .modal-header {
363
+ @apply flex items-start justify-between p-4 border-b border-gray-300 rounded-t
364
+ }
365
+
366
+ .modal-title {
367
+ @apply mb-0 leading-normal
368
+ }
369
+
370
+ .modal-body {
371
+ @apply relative flex p-4
372
+ }
373
+
374
+ .modal-footer {
375
+ @apply flex items-center justify-end p-4 border-t border-gray-300
376
+ }
377
+
378
+ .modal-footer > :not(:last-child) {
379
+ @apply mr-2
380
+ }
381
+
382
+ /*
383
+ * ============================
384
+ * Navbars
385
+ *=============================
386
+ */
387
+
388
+ .navbar {
389
+ @apply relative flex flex-wrap items-center justify-between py-1 px-4;
390
+ }
391
+
392
+ .fixed-top {
393
+ @apply fixed top-0 right-0 left-0 z-40
394
+ }
395
+
396
+ .navbar-brand {
397
+ @apply inline-block py-1 mr-4 text-xl
398
+ }
399
+
400
+ .navbar-light .navbar-brand {
401
+ @apply text-gray-900
402
+ }
403
+
404
+ .navbar-dark .navbar-brand {
405
+ @apply text-gray-100
406
+ }
407
+
408
+ .navbar-toggler {
409
+ @apply inline-block py-1 px-3 leading-none bg-transparent border border-transparent rounded
410
+ }
411
+
412
+ .navbar-light .navbar-toggler {
413
+ @apply text-gray-500 border-gray-400
414
+ }
415
+
416
+ .navbar-dark .navbar-toggler {
417
+ @apply text-gray-500 border-gray-700
418
+ }
419
+
420
+ .navbar-light .navbar-toggler-icon {
421
+ background-image: url("data:image/svg+xml,<svg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'><path stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/></svg>");
422
+ }
423
+
424
+ .navbar-dark .navbar-toggler-icon {
425
+ background-image: url("data:image/svg+xml,<svg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'><path stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/></svg>");
426
+ }
427
+
428
+ .navbar-toggler-icon {
429
+ content: "";
430
+ @apply inline-block w-6 h-6 align-middle bg-center bg-no-repeat
431
+ }
432
+
433
+ .navbar-collapse {
434
+ @apply hidden w-full flex-grow items-center
435
+ }
436
+
437
+ .navbar-collapse.show, .navbar-collapse.in {
438
+ @apply block
439
+ }
440
+
441
+ .navbar-nav {
442
+ @apply flex flex-col pl-0 mb-0 list-none;
443
+ }
444
+
445
+ .nav-link {
446
+ @apply block py-2 px-4
447
+ }
448
+
449
+ .collapse.show .nav-link, .collapse.in .nav-link {
450
+ @apply px-0
451
+ }
452
+
453
+ .navbar-light .navbar-nav .nav-link {
454
+ @apply text-gray-600
455
+ }
456
+
457
+ .navbar-light .navbar-nav .nav-link:hover {
458
+ @apply text-gray-800
459
+ }
460
+
461
+ .navbar-light .navbar-nav .active > .nav-link, .navbar-light .navbar-nav .nav-link.active {
462
+ @apply text-gray-900
463
+ }
464
+
465
+ .navbar-light .navbar-nav .nav-link.disabled {
466
+ @apply text-gray-500 pointer-events-none
467
+ }
468
+
469
+ .navbar-dark .navbar-nav .nav-link {
470
+ @apply text-gray-600
471
+ }
472
+
473
+ .navbar-dark .navbar-nav .nav-link:hover {
474
+ @apply text-gray-500
475
+ }
476
+
477
+ .navbar-dark .navbar-nav .active > .nav-link, .navbar-dark .navbar-nav .nav-link.active {
478
+ @apply text-gray-200
479
+ }
480
+
481
+ .navbar-dark .navbar-nav .nav-link.disabled {
482
+ @apply text-gray-700 pointer-events-none
483
+ }
484
+
485
+ /*
486
+ * ============================
487
+ * Tables
488
+ *=============================
489
+ */
490
+
491
+ th {
492
+ text-align: inherit;
493
+ }
494
+
495
+ .table {
496
+ @apply w-full mb-4 text-gray-900
497
+ }
498
+
499
+ .table thead th {
500
+ @apply align-bottom border-b-2 border-gray-300
501
+ }
502
+
503
+ .table td, .table th {
504
+ @apply p-3 border-t border-gray-300
505
+ }
506
+
507
+ .table.table-bordered {
508
+ @apply border border-gray-300
509
+ }
510
+
511
+ .table-bordered td, .table-bordered th {
512
+ @apply border border-gray-300
513
+ }
514
+ }
@@ -0,0 +1,15 @@
1
+ class ApplicationController < ActionController::Base
2
+ def css_framework
3
+ @css_framework ||= 'bootstrap'
4
+ "application_#{@css_framework}"
5
+ end
6
+ helper_method :css_framework
7
+
8
+ def css_framework_bootstrap
9
+ @css_framework = 'bootstrap'
10
+ end
11
+
12
+ def css_framework_tailwind
13
+ @css_framework = 'tailwind'
14
+ end
15
+ end