css-zero 0.0.16 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -325
  3. data/app/assets/stylesheets/_reset.css +10 -21
  4. data/app/assets/stylesheets/typography.css +16 -4
  5. data/app/assets/stylesheets/zutilities.css +9 -2
  6. data/app/helpers/dialog_helper.rb +5 -0
  7. data/lib/css_zero/version.rb +1 -1
  8. data/lib/generators/css_zero/add/USAGE +1 -1
  9. data/lib/generators/css_zero/add/resources.yml +12 -0
  10. data/lib/generators/css_zero/add/templates/app/assets/images/chevron-left.svg +1 -0
  11. data/lib/generators/css_zero/add/templates/app/assets/images/chevron-right.svg +1 -0
  12. data/lib/generators/css_zero/add/templates/app/assets/images/ellipsis.svg +1 -0
  13. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/accordion.css +1 -1
  14. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/alert.css +2 -2
  15. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/avatar.css +29 -0
  16. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/badge.css +3 -1
  17. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/breadcrumb.css +22 -0
  18. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/button.css +2 -2
  19. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/dialog.css +11 -3
  20. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/input.css +22 -4
  21. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/pagination.css +33 -0
  22. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/switch.css +1 -1
  23. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/table.css +1 -1
  24. data/lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js +17 -0
  25. data/lib/generators/css_zero/install/templates/app/assets/stylesheets/base.css +6 -2
  26. metadata +10 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25eac2e80a7b075843033e5db405786dd14e9f802cb47ce2fd1f0375e7841565
4
- data.tar.gz: 52cd0c2ed8d8eb740d44e29210ff8652088cac7509ccf024a957f837ada2cfc2
3
+ metadata.gz: e0160a1de6cec67785d5c12b68ab51a020dddf109aab5e76bb1dc1c15ca4c5d3
4
+ data.tar.gz: 60d34a2b612a22f5c8adfbe759a570ed507afaabd9192d3a5d34393384b49d9a
5
5
  SHA512:
6
- metadata.gz: 39e8b29cb429cf7e8d4d180682c17cef15e5105f51fc9c0b88ece548f688a41558569f2aeda76bf9365df202b6e01f791dd7520b5225ef0357a80e1d0a39ed70
7
- data.tar.gz: 52d7914ad684c3b27766979afa42834796a361846dc679d2a44300ed1858a92490f1f5c09665b0bb40a0e4671303de8402dc4127eda6ab25d8cebc7df389318c
6
+ metadata.gz: df8b92602ece5cc374d5fd806a07c54a20c889de3e078e2c1f1322df0cf3eca85e6e10c6a9115d794fdf6aaa538c967e911cebfa1c6588af881f9faf48b161e1
7
+ data.tar.gz: 4bdfaf4732cf6d971d1fc28de2dc60e7c4bc7af3f128097573e61a1104d59e474a8f344d09731d4a523e40c2a9485c07671d62d17d128817bca37b0b221ec1f8
data/README.md CHANGED
@@ -19,7 +19,7 @@ bin/rails generate css_zero:install
19
19
  Add only the components you need. (Optional)
20
20
 
21
21
  ```
22
- bin/rails generate css_zero:add accordion alert badge button card dialog input progress switch table
22
+ bin/rails generate css_zero:add accordion alert avatar badge breadcrumb button card collapsible dialog input pagination progress switch table
23
23
  ```
24
24
 
25
25
  ### Requirements
@@ -89,331 +89,9 @@ Check the [CSS files](app/assets/stylesheets) in the repository to see the avail
89
89
 
90
90
  ## Components
91
91
 
92
- ### Accordion
92
+ [<img src="https://github.com/user-attachments/assets/989b0ddd-064a-4ac6-8aee-f9eaaf07ff38">](https://css-zero-showcase.onrender.com/lookbook)
93
93
 
94
- <img width="500" alt="accordion" src="https://github.com/lazaronixon/css-zero/assets/2651240/9644edec-9bb1-4e1f-b2da-19c7fb5a540f">
95
-
96
- <details>
97
- <summary>Show me the code</summary>
98
-
99
- ```html+erb
100
- <div class="accordion">
101
- <details name="my_accordion">
102
- <summary>Is it accessible?</summary>
103
- <p class="text-sm">Yes. It adheres to the WAI-ARIA design pattern.</p>
104
- </details>
105
- <details name="my_accordion">
106
- <summary>Is it styled?</summary>
107
- <p class="text-sm">Yes. It comes with default styles that matches the other components' aesthetic.</p>
108
- </details>
109
- <details name="my_accordion">
110
- <summary>Is it animated?</summary>
111
- <p class="text-sm">Yes. It's animated by default, but you can disable it if you prefer.</p>
112
- </details>
113
- </div>
114
- ```
115
- </details>
116
-
117
- ### Alert
118
-
119
- <img width="500" alt="alert" src="https://github.com/lazaronixon/css-zero/assets/2651240/eae5c6dd-f6b4-4c01-bec1-cd7e9523d0a6">
120
-
121
- <details>
122
- <summary>Show me the code</summary>
123
-
124
- ```html+erb
125
- <div class="alert alert--negative flex items-start gap">
126
- <%= image_tag("circle-alert.svg", role: "presentation", size: 16) %>
127
- <div class="flex flex-col">
128
- <h1 class="font-medium leading-none mbe-1">Error</h1>
129
- <p class="text-sm">Your session has expired. Please log in again.</p>
130
- </div>
131
- </div>
132
- ```
133
- </details>
134
-
135
- ### Badge
136
-
137
- <img width="400" alt="image" src="https://github.com/lazaronixon/css-zero/assets/2651240/6a700dc4-0fd5-46f6-9902-a9bde5f7febb">
138
-
139
- <details>
140
- <summary>Show me the code</summary>
141
-
142
- ```html+erb
143
- <div class="flex justify-start gap">
144
- <div class="badge">Badge</div>
145
- <div class="badge badge--secondary">Secondary</div>
146
- <div class="badge badge--outline">Outline</div>
147
- <div class="badge badge--positive">Positive</div>
148
- <div class="badge badge--negative">Negative</div>
149
- </div>
150
- ```
151
- </details>
152
-
153
- ### Button
154
-
155
- <img width="500" alt="button" src="https://github.com/lazaronixon/css-zero/assets/2651240/df78c11e-9167-4fd3-a779-24729cb24715">
156
-
157
- <details>
158
- <summary>Show me the code</summary>
159
-
160
- ```html+erb
161
- <div class="flex flex-wrap items-center gap" aria-busy>
162
- <button class="btn">Primary</button>
163
- <button class="btn btn--secondary">Secondary</button>
164
- <button class="btn btn--outline">Outline</button>
165
- <button class="btn btn--plain">Plain</button>
166
- <button class="btn btn--positive">Positive</button>
167
- <button class="btn btn--negative">Negative</button>
168
-
169
- <button class="btn">
170
- <%= image_tag "circle-plus.svg", role: "presentation", size: 16 %>
171
- <span>With icon</span>
172
- </button>
173
-
174
- <button class="btn btn--loading" disabled>
175
- <span>Please wait</span>
176
- </button>
177
- </div>
178
- ```
179
- </details>
180
-
181
- ### Card
182
-
183
- <img width="366" alt="image" src="https://github.com/lazaronixon/css-zero/assets/2651240/f4077b91-2d0c-49db-9fb6-2955f8575217">
184
-
185
- <details>
186
- <summary>Show me the code</summary>
187
-
188
- ```html+erb
189
- <div class="card flex flex-col gap" style="width: 350px; gap: 1.5rem;">
190
- <div class="flex flex-col gap-sm">
191
- <h1 class="text-2xl font-semibold leading-none">Create project</h1>
192
- <p class="text-sm text-subtle">Deploy your new project in one-click.</p>
193
- </div>
194
-
195
- <div class="flex flex-col gap">
196
- <div class="flex flex-col gap-sm">
197
- <label for="name" class="text-sm font-medium">Name</label>
198
- <input type="text" id="name" placeholder="Name of your project" class="input">
199
- </div>
200
-
201
- <div class="flex flex-col gap-sm">
202
- <label for="framework" class="text-sm font-medium">Framework</label>
203
- <select id="framework" class="input">
204
- <option value="">Select</option>
205
- <option value="rails">Ruby on Rails</option>
206
- <option value="laravel">Laravel</option>
207
- <option value="next">Next</option>
208
- </select>
209
- </div>
210
- </div>
211
-
212
- <div class="flex justify-between">
213
- <button class="btn btn--outline">Cancel</button>
214
- <button class="btn">Destroy</button>
215
- </div>
216
- </div>
217
- ```
218
- </details>
219
-
220
- ### Dialog
221
-
222
- #### Alert Dialog
223
-
224
- <img width="500" alt="alert_dialog" src="https://github.com/lazaronixon/css-zero/assets/2651240/483b00fc-0330-45b3-82c5-dc4118987564">
225
-
226
- <details>
227
- <summary>Show me the code</summary>
228
-
229
- ```html+erb
230
- <div data-controller="dialog">
231
- <dialog data-dialog-target="box" class="dialog">
232
- <h1 class="text-lg font-semibold">Are you absolutely sure?</h1>
233
- <p class="text-sm text-subtle mbs-2">This action cannot be undone. This will permanently delete your account and remove your data from our servers.</p>
234
-
235
- <div class="flex justify-end gap-sm mbs-4">
236
- <form method="dialog"><button class="btn btn--outline">Cancel</button></form>
237
- <button class="btn btn--primary">Continue</button>
238
- </div>
239
- </dialog>
240
-
241
- <button class="btn" data-action="dialog#showModal">
242
- Show dialog
243
- </button>
244
- </div>
245
- ```
246
- </details>
247
-
248
- #### Dismissible Dialog
249
-
250
- <img width="400" alt="dismissible_dialog" src="https://github.com/lazaronixon/css-zero/assets/2651240/50c8af20-46bb-4bf9-a233-78877f49e086">
251
-
252
- <details>
253
- <summary>Show me the code</summary>
254
-
255
- ```html+erb
256
- <div data-controller="dialog">
257
- <dialog data-dialog-target="box" data-action="click->dialog#closeOnClickOutside" class="dialog" style="max-inline-size: 430px;">
258
- <form method="dialog">
259
- <button class="btn btn--plain p-0 dialog__close">
260
- <%= image_tag "x.svg", aria: { hidden: "true" }, size: 16 %>
261
- <span class="sr-only">Close</span>
262
- </button>
263
- </form>
264
-
265
- <div class="flex flex-col gap">
266
- <div class="flex flex-col gap-sm">
267
- <h1 class="text-lg leading-none font-semibold">Edit profile</h1>
268
- <p class="text-sm text-subtle">Make changes to your profile here. Click save when you're done.</p>
269
- </div>
270
-
271
- <div class="flex flex-col mb-4 gap">
272
- <div class="grid grid-cols-4 items-center gap">
273
- <label for="name" class="text-sm font-medium text-end">Name</label>
274
- <input type="text" id="name" value="Lázaro Nixon" class="input col-span-3">
275
- </div>
276
-
277
- <div class="grid grid-cols-4 items-center gap">
278
- <label for="username" class="text-sm font-medium text-end">Username</label>
279
- <input type="text" id="username" value="@lazaronixon" class="input col-span-3">
280
- </div>
281
- </div>
282
-
283
- <div class="flex items-center justify-end">
284
- <input type="submit" value= "Save changes" class="btn"/>
285
- </div>
286
- </div>
287
- </dialog>
288
-
289
- <button class="btn" data-action="dialog#showModal">
290
- Show dialog
291
- </button>
292
- </div>
293
- ```
294
- </details>
295
-
296
- ### Input
297
-
298
- <img width="500" alt="input" src="https://github.com/lazaronixon/css-zero/assets/2651240/f33a9d34-44b5-4c6b-ad88-1f0fd00b7291">
299
-
300
- <details>
301
- <summary>Show me the code</summary>
302
-
303
- ```html+erb
304
- <%= form_with url: "/users", class: "flex flex-col gap" do |form| %>
305
- <div class="flex flex-col gap-sm">
306
- <%= form.label :name, class: "text-sm font-medium" %>
307
- <%= form.text_field :name, class: "input" %>
308
- </div>
309
-
310
- <div class="flex flex-col gap-sm">
311
- <%= form.label :pick_a_date, class: "text-sm font-medium" %>
312
- <%= form.date_field :pick_a_date, class: "input" %>
313
- </div>
314
-
315
- <div class="flex flex-col gap-sm">
316
- <%= form.label :age_range, class: "text-sm font-medium" %>
317
- <%= form.select :age_range, ["0-13", "14-17", "18-23"], {}, class: "input" %>
318
- </div>
319
-
320
- <div class="flex flex-col gap-sm">
321
- <%= form.label :comment, class: "text-sm font-medium" %>
322
- <%= form.text_area :comment, rows: 3, class: "input" %>
323
- </div>
324
-
325
- <div class="flex items-center gap-sm">
326
- <%= form.check_box :status, class: "checkbox" %>
327
- <%= form.label :status, "Send a copy to yourself", class: "text-sm font-medium" %>
328
- </div>
329
- <% end %>
330
- ```
331
- </details>
332
-
333
- ### Progress
334
-
335
- <img width="500" alt="progress" src="https://github.com/lazaronixon/css-zero/assets/2651240/32f7b665-ae85-48de-9338-0c255019122e">
336
-
337
- <details>
338
- <summary>Show me the code</summary>
339
-
340
- ```html
341
- <label>
342
- <span class="sr-only">Loading progress</span>
343
- <progress value="75" max="100" class="progress"></progress>
344
- </label>
345
- ```
346
- </details>
347
-
348
- ### Switch
349
-
350
- <img width="175" alt="image" src="https://github.com/lazaronixon/css-zero/assets/2651240/b47e28fb-6492-402c-b422-b896dfd3b713">
351
-
352
- <details>
353
- <summary>Show me the code</summary>
354
-
355
- ```html+erb
356
- <div class="flex items-center gap-sm">
357
- <input type="checkbox" class="switch">
358
- <label for="status" class="text-sm font-medium">Airplane Mode</label>
359
- </div>
360
- ```
361
- </details>
362
-
363
- ### Table
364
-
365
- <img width="500" alt="image" src="https://github.com/lazaronixon/css-zero/assets/2651240/c7b261a8-6d38-46f2-bf69-fd9385776bbe">
366
-
367
- <details>
368
- <summary>Show me the code</summary>
369
-
370
- ```html+erb
371
- <table class="table">
372
- <thead>
373
- <tr>
374
- <th>Invoice</th>
375
- <th>Status</th>
376
- <th>Method</th>
377
- <th class="text-end">Amount</th>
378
- </tr>
379
- </thead>
380
- <tbody>
381
- <tr>
382
- <th>INV001</th>
383
- <td>Paid</td>
384
- <td>Credit Card</td>
385
- <td class="text-end">$250.00</td>
386
- </tr>
387
- <tr>
388
- <th>INV002</th>
389
- <td>Pending</td>
390
- <td>PayPal</td>
391
- <td class="text-end">$150.00</td>
392
- </tr>
393
- <tr>
394
- <th>INV003</th>
395
- <td>Unpaid</td>
396
- <td>Transfer</td>
397
- <td class="text-end">$350.00</td>
398
- </tr>
399
- <tr>
400
- <th>INV004</th>
401
- <td>Paid</td>
402
- <td>Credit Card</td>
403
- <td class="text-end">$450.00</td>
404
- </tr>
405
- </tbody>
406
- <tfoot>
407
- <tr>
408
- <td colspan="3">Paid</td>
409
- <td class="text-end">$2,500.00</td>
410
- </tr>
411
- </tfoot>
412
- </table>
413
- ```
414
- </details>
415
-
416
- ### More components soon...
94
+ More components soon...
417
95
 
418
96
  ## Development
419
97
 
@@ -30,16 +30,7 @@ html,
30
30
  line-height: 1.5; /* 1 */
31
31
  -webkit-text-size-adjust: 100%; /* 2 */
32
32
  tab-size: 4; /* 3 */
33
- font-family: var(
34
- --default-font-family,
35
- ui-sans-serif,
36
- system-ui,
37
- sans-serif,
38
- 'Apple Color Emoji',
39
- 'Segoe UI Emoji',
40
- 'Segoe UI Symbol',
41
- 'Noto Color Emoji'
42
- ); /* 4 */
33
+ font-family: var(--default-font-family, system-ui, sans-serif); /* 4 */
43
34
  font-feature-settings: var(--default-font-feature-settings, normal); /* 5 */
44
35
  font-variation-settings: var(--default-font-variation-settings, normal); /* 6 */
45
36
  -webkit-tap-highlight-color: transparent; /* 7 */
@@ -118,17 +109,7 @@ code,
118
109
  kbd,
119
110
  samp,
120
111
  pre {
121
- font-family: var(
122
- --default-mono-font-family,
123
- ui-monospace,
124
- SFMono-Regular,
125
- Menlo,
126
- Monaco,
127
- Consolas,
128
- 'Liberation Mono',
129
- 'Courier New',
130
- monospace
131
- ); /* 4 */
112
+ font-family: var(--default-mono-font-family, ui-monospace, monospace); /* 4 */
132
113
  font-feature-settings: var(--default-mono-font-feature-settings, normal); /* 5 */
133
114
  font-variation-settings: var(--default-mono-font-variation-settings, normal); /* 6 */
134
115
  font-size: 1em; /* 4 */
@@ -245,6 +226,14 @@ progress {
245
226
  block-size: auto;
246
227
  }
247
228
 
229
+ /*
230
+ Correct the arrow style of datalist in Chrome.
231
+ */
232
+
233
+ ::-webkit-calendar-picker-indicator {
234
+ line-height: 1em;
235
+ }
236
+
248
237
  /*
249
238
  Remove the inner padding in Chrome and Safari on macOS.
250
239
  */
@@ -54,13 +54,25 @@
54
54
  --leading-10: 2.5rem; /* 40px */
55
55
 
56
56
  /****************************************************************
57
- * Font Family
57
+ * Font Family (https://modernfontstacks.com)
58
58
  * Variables for controlling the font family of an element.
59
59
  * font-family: var(--font-sans);
60
60
  *****************************************************************/
61
- --font-sans: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
62
- --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
63
- --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
61
+ --font-system-ui: system-ui, sans-serif;
62
+ --font-transitional: Charter, Bitstream Charter, Sitka Text, Cambria, serif;
63
+ --font-old-style: Iowan Old Style, Palatino Linotype, URW Palladio L, P052, serif;
64
+ --font-humanist: Seravek, Gill Sans Nova, Ubuntu, Calibri, DejaVu Sans, source-sans-pro, sans-serif;
65
+ --font-geometric-humanist: Avenir, Montserrat, Corbel, URW Gothic, source-sans-pro, sans-serif;
66
+ --font-classical-humanist: Optima, Candara, Noto Sans, source-sans-pro, sans-serif;
67
+ --font-neo-grotesque: Inter, Roboto, Helvetica Neue, Arial Nova, Nimbus Sans, Arial, sans-serif;
68
+ --font-monospace-slab-serif: Nimbus Mono PS, Courier New, monospace;
69
+ --font-monospace-code: Dank Mono, Operator Mono, Inconsolata, Fira Mono, ui-monospace, SF Mono, Monaco, Droid Sans Mono, Source Code Pro, Cascadia Code, Menlo, Consolas, DejaVu Sans Mono, monospace;
70
+ --font-industrial: Bahnschrift, DIN Alternate, Franklin Gothic Medium, Nimbus Sans Narrow, sans-serif-condensed, sans-serif;
71
+ --font-rounded-sans: ui-rounded, Hiragino Maru Gothic ProN, Quicksand, Comfortaa, Manjari, Arial Rounded MT, Arial Rounded MT Bold, Calibri, source-sans-pro, sans-serif;
72
+ --font-slab-serif: Rockwell, Rockwell Nova, Roboto Slab, DejaVu Serif, Sitka Small, serif;
73
+ --font-antique: Superclarendon, Bookman Old Style, URW Bookman, URW Bookman L, Georgia Pro, Georgia, serif;
74
+ --font-didone: Didot, Bodoni MT, Noto Serif Display, URW Palladio L, P052, Sylfaen, serif;
75
+ --font-handwritten: Segoe Print, Bradley Hand, Chilanka, TSCu_Comic, casual, cursive;
64
76
 
65
77
  /****************************************************************
66
78
  * Letter Spacing
@@ -45,7 +45,7 @@
45
45
  .whitespace-nowrap { white-space: nowrap; }
46
46
  .whitespace-normal { white-space: normal; }
47
47
 
48
- .break-words { word-break: break-word; }
48
+ .break-words { overflow-wrap: break-word; }
49
49
  .break-all { word-break: break-all; }
50
50
 
51
51
  .overflow-clip { text-overflow: clip; white-space: nowrap; overflow: hidden; }
@@ -88,7 +88,7 @@
88
88
  .bg-main { background-color: var(--color-bg); }
89
89
  .bg-black { background-color: var(--color-text); }
90
90
  .bg-white { background-color: var(--color-text-reversed); }
91
- .bg-shade { background-color: var(--color-secondary); }
91
+ .bg-shade { background-color: var(--color-border-light); }
92
92
  .bg-transparent { background-color: transparent; }
93
93
 
94
94
  /****************************************************************
@@ -96,6 +96,7 @@
96
96
  *****************************************************************/
97
97
  .colorize-black { filter: var(--color-filter-text); }
98
98
  .colorize-white { filter: var(--color-filter-text-reversed); }
99
+ .colorize-shade { filter: var(--color-filter-text-subtle); }
99
100
  .colorize-negative { filter: var(--color-filter-negative); }
100
101
  .colorize-positive { filter: var(--color-filter-positive); }
101
102
 
@@ -109,6 +110,12 @@
109
110
  .border-is { border-inline-start-width: var(--border-size, 1px); }
110
111
  .border-ie { border-inline-end-width: var(--border-size, 1px); }
111
112
 
113
+ .border-main { border-color: var(--color-border); }
114
+ .border-dark { border-color: var(--color-border-dark); }
115
+
116
+ .border-solid { border-style: solid; }
117
+ .border-dashed { border-style: dashed; }
118
+
112
119
  .rounded-none { border-radius: none; }
113
120
  .rounded-sm { border-radius: var(--rounded-sm); }
114
121
  .rounded { border-radius: var(--rounded); }
@@ -0,0 +1,5 @@
1
+ module DialogHelper
2
+ def button_to_close_dialog(content = nil, **, &)
3
+ tag.form tag.button(content, **, &), method: :dialog
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module CssZero
2
- VERSION = "0.0.16"
2
+ VERSION = "0.0.18"
3
3
  end
@@ -2,7 +2,7 @@ Description:
2
2
  This will add components into your project.
3
3
 
4
4
  Components:
5
- accordion alert badge button card dialog input progress switch table
5
+ accordion alert avatar badge breadcrumb button card collapsible dialog input pagination progress switch table
6
6
 
7
7
  Example:
8
8
  bin/rails generate css_zero:add [components...]
@@ -3,13 +3,20 @@ accordion:
3
3
  - app/assets/images/chevron-down.svg
4
4
  alert:
5
5
  - app/assets/stylesheets/alert.css
6
+ avatar:
7
+ - app/assets/stylesheets/avatar.css
6
8
  badge:
7
9
  - app/assets/stylesheets/badge.css
10
+ breadcrumb:
11
+ - app/assets/stylesheets/breadcrumb.css
12
+ - app/assets/images/chevron-right.svg
8
13
  button:
9
14
  - app/assets/stylesheets/button.css
10
15
  - app/assets/images/loader-circle.svg
11
16
  card:
12
17
  - app/assets/stylesheets/card.css
18
+ collapsible:
19
+ - app/javascript/controllers/collapsible_controller.js
13
20
  dialog:
14
21
  - app/assets/stylesheets/dialog.css
15
22
  - app/assets/images/x.svg
@@ -17,6 +24,11 @@ dialog:
17
24
  input:
18
25
  - app/assets/stylesheets/input.css
19
26
  - app/assets/images/select-arrow.svg
27
+ pagination:
28
+ - app/assets/stylesheets/pagination.css
29
+ - app/assets/images/chevron-right.svg
30
+ - app/assets/images/chevron-left.svg
31
+ - app/assets/images/ellipsis.svg
20
32
  progress:
21
33
  - app/assets/stylesheets/progress.css
22
34
  switch:
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 18 6-6-6-6"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></svg>
@@ -23,7 +23,7 @@
23
23
  padding-block: var(--size-4);
24
24
 
25
25
  &:focus-visible {
26
- outline: var(--border-2) solid var(--color-border-darker);
26
+ outline: var(--border-2) solid var(--color-border-dark);
27
27
  outline-offset: var(--border-2);
28
28
  }
29
29
 
@@ -6,8 +6,8 @@
6
6
  padding: var(--size-4);
7
7
  inline-size: var(--size-full);
8
8
 
9
- img:not([class]) {
10
- filter: var(--alert-icon-color, var(--color-filter-text-reversed));
9
+ img {
10
+ filter: var(--alert-icon-color, var(--color-filter-text));
11
11
  }
12
12
  }
13
13
 
@@ -0,0 +1,29 @@
1
+ .avatar {
2
+ --size: var(--avatar-size, var(--size-10));
3
+
4
+ block-size: var(--size);
5
+ border-radius: var(--rounded-full);
6
+ display: flex;
7
+ flex-shrink: 0;
8
+ inline-size: var(--size);
9
+ overflow: hidden;
10
+
11
+ img {
12
+ aspect-ratio: 1;
13
+ block-size: var(--size-full);
14
+ inline-size: var(--size-full);
15
+ object-fit: cover;
16
+ }
17
+ }
18
+
19
+ .avatar__fallback {
20
+ align-items: center;
21
+ background-color: var(--color-border-light);
22
+ block-size: var(--size-full);
23
+ border-radius: var(--rounded-full);
24
+ display: flex;
25
+ font-size: calc(var(--size) * .4);
26
+ inline-size: var(--size-full);
27
+ justify-content: center;
28
+ user-select: none;
29
+ }
@@ -1,8 +1,10 @@
1
1
  .badge {
2
+ align-items: center;
2
3
  background-color: var(--badge-background, var(--color-primary));
3
4
  border-radius: var(--rounded-full);
4
5
  border-width: var(--badge-border-width, 0);
5
6
  color: var(--badge-color, var(--color-text-reversed));
7
+ display: inline-flex;
6
8
  font-size: var(--text-xs);
7
9
  font-weight: var(--font-semibold);
8
10
  padding: var(--size-0_5) var(--size-2_5);
@@ -15,8 +17,8 @@
15
17
 
16
18
  .badge--outline {
17
19
  --badge-background: transparent;
20
+ --badge-border-width: var(--border);
18
21
  --badge-color: var(--color-text);
19
- --btn-border-width: var(--border);
20
22
  }
21
23
 
22
24
  .badge--positive {
@@ -0,0 +1,22 @@
1
+ .breadcrumb {
2
+ align-items: center;
3
+ color: var(--color-text-subtle);
4
+ display: flex;
5
+ flex-wrap: wrap;
6
+ font-size: var(--text-sm);
7
+ gap: var(--size-2_5);
8
+ overflow-wrap: break-word;
9
+
10
+ img {
11
+ filter: var(--color-filter-text-subtle);
12
+ }
13
+
14
+ a:hover {
15
+ color: var(--color-text);
16
+ }
17
+
18
+ /* Small screens and below */
19
+ @media (width < 40rem) {
20
+ gap: var(--size-1_5);
21
+ }
22
+ }
@@ -15,12 +15,12 @@
15
15
  padding: var(--size-2) var(--size-4);
16
16
  text-align: center;
17
17
 
18
- img:not([class]) {
18
+ img {
19
19
  filter: var(--btn-icon-color, var(--color-filter-text-reversed));
20
20
  }
21
21
 
22
22
  &:focus-visible {
23
- outline: var(--border-2) solid var(--color-border-darker);
23
+ outline: var(--border-2) solid var(--color-border-dark);
24
24
  outline-offset: var(--border-2);
25
25
  }
26
26
 
@@ -6,7 +6,7 @@
6
6
  color: var(--color-text);
7
7
  inline-size: var(--size-full);
8
8
  margin: auto;
9
- max-inline-size: var(--width-lg);
9
+ max-inline-size: var(--dialog-width, var(--width-lg));
10
10
  padding: var(--size-6);
11
11
 
12
12
  &::backdrop {
@@ -47,9 +47,12 @@
47
47
  }
48
48
  }
49
49
 
50
- /* Small screens */
50
+ /* Small screens and below */
51
51
  @media (width < 40rem) {
52
- border-radius: 0;
52
+ border-end-end-radius: 0;
53
+ border-end-start-radius: 0;
54
+ margin-block-end: 0;
55
+ max-inline-size: none !important;
53
56
  }
54
57
  }
55
58
 
@@ -57,6 +60,11 @@
57
60
  inset-block-start: var(--size-4);
58
61
  inset-inline-end: var(--size-4);
59
62
  position: absolute;
63
+
64
+ /* Small screens and below */
65
+ @media (width < 40rem) {
66
+ display: none;
67
+ }
60
68
  }
61
69
 
62
70
  /* Prevent page scroll when dialog is open */
@@ -8,6 +8,17 @@
8
8
  font-size: var(--text-sm);
9
9
  inline-size: var(--size-full);
10
10
  padding: var(--size-2) var(--size-3);
11
+ resize: none;
12
+
13
+ option {
14
+ padding-block: var(--size-1);
15
+ }
16
+
17
+ &:is(textarea):not([rows]) {
18
+ field-sizing: content;
19
+ max-block-size: calc(10lh + var(--size-6));
20
+ min-block-size: calc(3lh + var(--size-6));
21
+ }
11
22
 
12
23
  &:is(select):not([multiple], [size]) {
13
24
  background-image: url("select-arrow.svg");
@@ -44,8 +55,15 @@
44
55
  transform: scale(1.15);
45
56
  }
46
57
 
47
- /* Keyboard navigation */
48
- :is(.input, .range, .checkbox, .radio):focus-visible {
49
- outline: var(--border-2) solid var(--color-border-darker);
50
- outline-offset: var(--border-2);
58
+ :is(.input, .range, .checkbox, .radio) {
59
+ /* Keyboard navigation */
60
+ &:focus-visible {
61
+ outline: var(--border-2) solid var(--color-border-dark);
62
+ outline-offset: var(--border-2);
63
+ }
64
+
65
+ /* Server side validation */
66
+ .field_with_errors & {
67
+ border-color: var(--color-negative);
68
+ }
51
69
  }
@@ -0,0 +1,33 @@
1
+ :where(.pagination) {
2
+ align-items: center;
3
+ display: flex;
4
+ gap: var(--size-1);
5
+
6
+ img {
7
+ filter: var(--color-filter-text);
8
+ }
9
+
10
+ a {
11
+ align-items: center;
12
+ border-radius: var(--rounded-md);
13
+ display: inline-flex;
14
+ font-size: var(--text-sm);
15
+ font-weight: var(--font-medium);
16
+ gap: var(--size-2);
17
+ justify-content: center;
18
+ min-inline-size: fit-content;
19
+ padding: var(--size-2) var(--size-4);
20
+ }
21
+
22
+ a:is([aria-current]) {
23
+ border-width: var(--border);
24
+ }
25
+
26
+ a:is([aria-disabled]) {
27
+ pointer-events: none;
28
+ }
29
+
30
+ a:not([aria-disabled]):hover {
31
+ background-color: var(--color-secondary);
32
+ }
33
+ }
@@ -30,7 +30,7 @@
30
30
  }
31
31
 
32
32
  &:focus-visible {
33
- outline: var(--border-2) solid var(--color-border-darker);
33
+ outline: var(--border-2) solid var(--color-border-dark);
34
34
  outline-offset: var(--border-2);
35
35
  }
36
36
 
@@ -20,7 +20,7 @@
20
20
  }
21
21
 
22
22
  tfoot {
23
- background-color: var(--color-secondary);
23
+ background-color: var(--color-border-light);
24
24
  border-block-start-width: var(--border);
25
25
  font-weight: var(--font-medium);
26
26
  }
@@ -0,0 +1,17 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ export default class extends Controller {
4
+ static targets = [ "details" ]
5
+
6
+ open() {
7
+ this.detailsTarget.open = true
8
+ }
9
+
10
+ close() {
11
+ this.detailsTarget.open = false
12
+ }
13
+
14
+ toggle() {
15
+ this.detailsTarget.open ? this.close() : this.open()
16
+ }
17
+ }
@@ -4,8 +4,9 @@
4
4
  --color-text: black;
5
5
  --color-text-reversed: white;
6
6
  --color-text-subtle: var(--zinc-500);
7
+ --color-border-light: var(--zinc-100);
7
8
  --color-border: var(--zinc-200);
8
- --color-border-darker: var(--zinc-400);
9
+ --color-border-dark: var(--zinc-400);
9
10
 
10
11
  /* Accent colors */
11
12
  --color-primary: var(--zinc-900);
@@ -16,6 +17,7 @@
16
17
  /* SVG color values */
17
18
  --color-filter-text: invert(0);
18
19
  --color-filter-text-reversed: invert(100%);
20
+ --color-filter-text-subtle: invert(43%) sepia(8%) saturate(340%) hue-rotate(202deg) brightness(99%) contrast(85%);
19
21
  --color-filter-negative: invert(31%) sepia(96%) saturate(4646%) hue-rotate(350deg) brightness(91%) contrast(89%);
20
22
  --color-filter-positive: invert(48%) sepia(74%) saturate(520%) hue-rotate(90deg) brightness(89%) contrast(90%);
21
23
 
@@ -25,8 +27,9 @@
25
27
  --color-text: white;
26
28
  --color-text-reversed: black;
27
29
  --color-text-subtle: var(--zinc-400);
30
+ --color-border-light: var(--zinc-800);
28
31
  --color-border: var(--zinc-800);
29
- --color-border-darker: var(--zinc-300);
32
+ --color-border-dark: var(--zinc-300);
30
33
 
31
34
  /* Accent colors */
32
35
  --color-primary: var(--zinc-50);
@@ -37,6 +40,7 @@
37
40
  /* SVG color values */
38
41
  --color-filter-text: invert(100%);
39
42
  --color-filter-text-reversed: invert(0);
43
+ --color-filter-text-subtle: invert(55%) sepia(98%) saturate(0%) hue-rotate(299deg) brightness(96%) contrast(94%);
40
44
  --color-filter-negative: invert(15%) sepia(83%) saturate(2066%) hue-rotate(345deg) brightness(87%) contrast(88%);
41
45
  --color-filter-positive: invert(23%) sepia(74%) saturate(495%) hue-rotate(91deg) brightness(88%) contrast(89%);
42
46
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: css-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lázaro Nixon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-04 00:00:00.000000000 Z
11
+ date: 2024-07-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: lazaronixon@hotmail.com
@@ -30,6 +30,7 @@ files:
30
30
  - app/assets/stylesheets/transition.css
31
31
  - app/assets/stylesheets/typography.css
32
32
  - app/assets/stylesheets/zutilities.css
33
+ - app/helpers/dialog_helper.rb
33
34
  - lib/css-zero.rb
34
35
  - lib/css_zero/engine.rb
35
36
  - lib/css_zero/version.rb
@@ -37,20 +38,27 @@ files:
37
38
  - lib/generators/css_zero/add/add_generator.rb
38
39
  - lib/generators/css_zero/add/resources.yml
39
40
  - lib/generators/css_zero/add/templates/app/assets/images/chevron-down.svg
41
+ - lib/generators/css_zero/add/templates/app/assets/images/chevron-left.svg
42
+ - lib/generators/css_zero/add/templates/app/assets/images/chevron-right.svg
40
43
  - lib/generators/css_zero/add/templates/app/assets/images/circle-alert.svg
44
+ - lib/generators/css_zero/add/templates/app/assets/images/ellipsis.svg
41
45
  - lib/generators/css_zero/add/templates/app/assets/images/loader-circle.svg
42
46
  - lib/generators/css_zero/add/templates/app/assets/images/select-arrow.svg
43
47
  - lib/generators/css_zero/add/templates/app/assets/images/x.svg
44
48
  - lib/generators/css_zero/add/templates/app/assets/stylesheets/accordion.css
45
49
  - lib/generators/css_zero/add/templates/app/assets/stylesheets/alert.css
50
+ - lib/generators/css_zero/add/templates/app/assets/stylesheets/avatar.css
46
51
  - lib/generators/css_zero/add/templates/app/assets/stylesheets/badge.css
52
+ - lib/generators/css_zero/add/templates/app/assets/stylesheets/breadcrumb.css
47
53
  - lib/generators/css_zero/add/templates/app/assets/stylesheets/button.css
48
54
  - lib/generators/css_zero/add/templates/app/assets/stylesheets/card.css
49
55
  - lib/generators/css_zero/add/templates/app/assets/stylesheets/dialog.css
50
56
  - lib/generators/css_zero/add/templates/app/assets/stylesheets/input.css
57
+ - lib/generators/css_zero/add/templates/app/assets/stylesheets/pagination.css
51
58
  - lib/generators/css_zero/add/templates/app/assets/stylesheets/progress.css
52
59
  - lib/generators/css_zero/add/templates/app/assets/stylesheets/switch.css
53
60
  - lib/generators/css_zero/add/templates/app/assets/stylesheets/table.css
61
+ - lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js
54
62
  - lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_controller.js
55
63
  - lib/generators/css_zero/install/USAGE
56
64
  - lib/generators/css_zero/install/install_generator.rb