css-zero 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9fa9b5a675b170c1792a89b840dea6339ee14768644531ec3a1d2b465068e4f5
4
- data.tar.gz: 165ee0886c7f61ffe76c06545b367c6b1c5a3cb883a49345433dd6965b748e6b
3
+ metadata.gz: 534451ca0aee9a1bf1b81e3831c6716e7ac071dbf0ec5f0c2e4805ef86cf9638
4
+ data.tar.gz: a9a70ae47d1253368e596483adab0134242292465b8b2e4dc20df18b246c7852
5
5
  SHA512:
6
- metadata.gz: f6c36eb3cc7eb625ee8ed8255bac1aaa409e30ae6202a3e1e6683df5f3be36c74f052d011ba49ed7fda0a1d91dc5fea3ef24aa15392e9ccf0b7c3b1431280dcb
7
- data.tar.gz: 52f6d8133c48e4b9e6fd0e6c57f844a7121a516d6cbef6fefac54a0db69759cf42224d9963431eabb05158d802b6a4f1271d869abf056988d034b9bced5d2120
6
+ metadata.gz: ffd516034332e7b6092dfa659536321295a5047d7e4ab745725c6ea3e9b03611caf8913a89417f680bf0a660c924eaf93264b29d0b4e57681556b3b87568e380
7
+ data.tar.gz: 8104a1a8a350126a5d5dbe74276ffaafd76aa4f85d8156e45aaf4630edf7fc9c0add9972e21c68392deb88666697117d52a01b02f077129910e729578b65b483
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 alert_dialog badge button card dialog input progress switch table
22
+ bin/rails generate css_zero:add accordion alert badge button card dialog input progress switch table
23
23
  ```
24
24
 
25
25
  ### Requirements
@@ -96,7 +96,7 @@ Check the [CSS files](app/assets/stylesheets) in the repository to see the avail
96
96
  <details>
97
97
  <summary>Show me the code</summary>
98
98
 
99
- ```html
99
+ ```html+erb
100
100
  <div class="accordion">
101
101
  <details name="my_accordion">
102
102
  <summary>Is it accessible?</summary>
@@ -132,32 +132,6 @@ Check the [CSS files](app/assets/stylesheets) in the repository to see the avail
132
132
  ```
133
133
  </details>
134
134
 
135
- ### Alert Dialog
136
-
137
- <img width="500" alt="alert_dialog" src="https://github.com/lazaronixon/css-zero/assets/2651240/483b00fc-0330-45b3-82c5-dc4118987564">
138
-
139
- <details>
140
- <summary>Show me the code</summary>
141
-
142
- ```html
143
- <div>
144
- <dialog id="my_alert_dialog" class="alert-dialog">
145
- <h1 class="text-lg font-semibold">Are you absolutely sure?</h1>
146
- <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>
147
-
148
- <div class="flex justify-end gap-sm mbs-4">
149
- <form method="dialog"><button class="btn btn--outline">Cancel</button></form>
150
- <button class="btn btn--primary">Continue</button>
151
- </div>
152
- </dialog>
153
-
154
- <button class="btn" data-controller="dialog-control" data-dialog-control-target-value="my_alert_dialog" data-action="dialog-control#showModal">
155
- Show alert dialog
156
- </button>
157
- </div>
158
- ```
159
- </details>
160
-
161
135
  ### Badge
162
136
 
163
137
  <img width="400" alt="image" src="https://github.com/lazaronixon/css-zero/assets/2651240/6a700dc4-0fd5-46f6-9902-a9bde5f7febb">
@@ -165,7 +139,7 @@ Check the [CSS files](app/assets/stylesheets) in the repository to see the avail
165
139
  <details>
166
140
  <summary>Show me the code</summary>
167
141
 
168
- ```html
142
+ ```html+erb
169
143
  <div class="flex justify-start gap">
170
144
  <div class="badge">Badge</div>
171
145
  <div class="badge badge--secondary">Secondary</div>
@@ -183,7 +157,7 @@ Check the [CSS files](app/assets/stylesheets) in the repository to see the avail
183
157
  <details>
184
158
  <summary>Show me the code</summary>
185
159
 
186
- ```html
160
+ ```html+erb
187
161
  <div class="flex flex-wrap items-center gap" aria-busy>
188
162
  <button class="btn">Primary</button>
189
163
  <button class="btn btn--secondary">Secondary</button>
@@ -211,7 +185,7 @@ Check the [CSS files](app/assets/stylesheets) in the repository to see the avail
211
185
  <details>
212
186
  <summary>Show me the code</summary>
213
187
 
214
- ```html
188
+ ```html+erb
215
189
  <div class="card flex flex-col gap" style="width: 350px; gap: 1.5rem;">
216
190
  <div class="flex flex-col gap-sm">
217
191
  <h1 class="text-2xl font-semibold leading-none">Create project</h1>
@@ -245,16 +219,43 @@ Check the [CSS files](app/assets/stylesheets) in the repository to see the avail
245
219
 
246
220
  ### Dialog
247
221
 
248
- <img width="400" alt="dialog" src="https://github.com/lazaronixon/css-zero/assets/2651240/50c8af20-46bb-4bf9-a233-78877f49e086">
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">
249
225
 
250
226
  <details>
251
227
  <summary>Show me the code</summary>
252
228
 
253
- ```html
254
- <artice class="flex flex-col pb-10 pi-2 mi-auto w-full" style="gap: 4rem; max-width: 32rem">
229
+ ```html+erb
255
230
  <div>
256
- <dialog id="my_dialog" class="dialog" style="max-inline-size: 430px;" popover>
257
- <button class="btn btn--plain p-0 dialog__close" popovertarget="my_dialog" popovertargetaction="hide">
231
+ <dialog id="alert_dialog" 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-controller="dialog-control" data-dialog-control-target-value="alert_dialog" data-action="dialog-control#showModal">
242
+ Show alert 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>
257
+ <dialog id="dismissible_dialog" class="dialog" style="max-inline-size: 430px;" popover>
258
+ <button class="btn btn--plain p-0 dialog__close" popovertarget="dismissible_dialog" popovertargetaction="hide">
258
259
  <%= image_tag "x.svg", aria: { hidden: "true" }, size: 16 %>
259
260
  <span class="sr-only">Close</span>
260
261
  </button>
@@ -283,8 +284,8 @@ Check the [CSS files](app/assets/stylesheets) in the repository to see the avail
283
284
  </div>
284
285
  </dialog>
285
286
 
286
- <button class="btn" popovertarget="my_dialog">
287
- Show dialog
287
+ <button class="btn" popovertarget="dismissible_dialog">
288
+ Show dismissible dialog
288
289
  </button>
289
290
  </div>
290
291
  ```
@@ -364,7 +365,7 @@ Check the [CSS files](app/assets/stylesheets) in the repository to see the avail
364
365
  <details>
365
366
  <summary>Show me the code</summary>
366
367
 
367
- ```html
368
+ ```html+erb
368
369
  <table class="table">
369
370
  <thead>
370
371
  <tr>
@@ -1,3 +1,3 @@
1
1
  module CssZero
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.14"
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 alert_dialog badge button card dialog input progress switch table
5
+ accordion alert badge button card dialog input progress switch table
6
6
 
7
7
  Example:
8
8
  bin/rails generate css_zero:add [components...]
@@ -3,9 +3,6 @@ accordion:
3
3
  - app/assets/images/chevron-down.svg
4
4
  alert:
5
5
  - app/assets/stylesheets/alert.css
6
- alert_dialog:
7
- - app/assets/stylesheets/alert_dialog.css
8
- - app/javascript/controllers/dialog_control_controller.js
9
6
  badge:
10
7
  - app/assets/stylesheets/badge.css
11
8
  button:
@@ -16,6 +13,7 @@ card:
16
13
  dialog:
17
14
  - app/assets/stylesheets/dialog.css
18
15
  - app/assets/images/x.svg
16
+ - app/javascript/controllers/dialog_control_controller.js
19
17
  input:
20
18
  - app/assets/stylesheets/input.css
21
19
  - app/assets/images/select-arrow.svg
@@ -28,21 +28,21 @@
28
28
  }
29
29
 
30
30
  /* In animation */
31
- &:popover-open {
31
+ &:is([open], :popover-open) {
32
32
  opacity: 1; transform: var(--scale-100);
33
33
  }
34
34
 
35
- &:popover-open::backdrop {
35
+ &:is([open], :popover-open)::backdrop {
36
36
  opacity: 1;
37
37
  }
38
38
 
39
39
  /* Out animation */
40
40
  @starting-style {
41
- &:popover-open {
41
+ &:is([open], :popover-open) {
42
42
  opacity: 0; transform: var(--scale-95);
43
43
  }
44
44
 
45
- &:popover-open::backdrop {
45
+ &:is([open], :popover-open)::backdrop {
46
46
  opacity: 0;
47
47
  }
48
48
  }
@@ -59,6 +59,6 @@
59
59
  }
60
60
 
61
61
  /* Prevent page scroll when dialog is open */
62
- html:has(.dialog:popover-open) {
62
+ html:has(.dialog:is([open], :popover-open)) {
63
63
  overflow: hidden;
64
64
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: css-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lázaro Nixon
@@ -43,7 +43,6 @@ files:
43
43
  - lib/generators/css_zero/add/templates/app/assets/images/x.svg
44
44
  - lib/generators/css_zero/add/templates/app/assets/stylesheets/accordion.css
45
45
  - lib/generators/css_zero/add/templates/app/assets/stylesheets/alert.css
46
- - lib/generators/css_zero/add/templates/app/assets/stylesheets/alert_dialog.css
47
46
  - lib/generators/css_zero/add/templates/app/assets/stylesheets/badge.css
48
47
  - lib/generators/css_zero/add/templates/app/assets/stylesheets/button.css
49
48
  - lib/generators/css_zero/add/templates/app/assets/stylesheets/card.css
@@ -1,59 +0,0 @@
1
- .alert-dialog {
2
- background-color: var(--color-bg);
3
- border-width: var(--border);
4
- border-radius: var(--rounded-lg);
5
- box-shadow: var(--shadow-lg);
6
- color: var(--color-text);
7
- inline-size: var(--size-full);
8
- margin: auto;
9
- max-inline-size: var(--width-lg);
10
- padding: var(--size-6);
11
-
12
- &::backdrop {
13
- background-color: rgba(0, 0, 0, .8);
14
- }
15
-
16
- /* Setup animation */
17
- opacity: 0;
18
- transform: var(--scale-95);
19
- transition-behavior: allow-discrete;
20
- transition-duration: var(--time-150);
21
- transition-property: display overlay opacity transform;
22
-
23
- &::backdrop {
24
- opacity: 0;
25
- transition-behavior: allow-discrete;
26
- transition-duration: var(--time-150);
27
- transition-property: display overlay opacity;
28
- }
29
-
30
- /* In animation */
31
- &[open] {
32
- opacity: 1; transform: var(--scale-100);
33
- }
34
-
35
- &[open]::backdrop {
36
- opacity: 1;
37
- }
38
-
39
- /* Out animation */
40
- @starting-style {
41
- &[open] {
42
- opacity: 0; transform: var(--scale-95);
43
- }
44
-
45
- &[open]::backdrop {
46
- opacity: 0;
47
- }
48
- }
49
-
50
- /* Small screens */
51
- @media (width < 40rem) {
52
- border-radius: 0;
53
- }
54
- }
55
-
56
- /* Prevent page scroll when alert dialog is open */
57
- html:has(.alert-dialog[open]) {
58
- overflow: hidden;
59
- }