css-zero 0.0.28 → 0.0.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/app/assets/stylesheets/_reset.css +2 -19
- data/app/assets/stylesheets/filters.css +22 -22
- data/app/assets/stylesheets/sizes.css +0 -4
- data/app/assets/stylesheets/transform.css +1 -1
- data/app/assets/stylesheets/transition.css +3 -4
- data/app/assets/stylesheets/zutilities.css +10 -36
- data/app/helpers/tabs_helper.rb +5 -0
- data/lib/css_zero/version.rb +1 -1
- data/lib/generators/css_zero/add/USAGE +1 -1
- data/lib/generators/css_zero/add/resources.yml +5 -0
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/accordion.css +10 -4
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/button.css +14 -20
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/carousel.css +1 -1
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/input.css +27 -13
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/layouts.css +47 -0
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/pagination.css +0 -1
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/sheet.css +13 -4
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/switch.css +1 -2
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/table.css +1 -1
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/tabs.css +24 -0
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/toggle.css +0 -1
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/tabs_controller.js +25 -0
- data/lib/generators/css_zero/install/templates/app/assets/stylesheets/base.css +5 -0
- metadata +6 -4
- data/app/assets/stylesheets/grid.css +0 -38
- data/app/assets/stylesheets/zindex.css +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8c460c71199f0ee11915508660def66aba8330d9e7ff2693233e370ffc71818
|
4
|
+
data.tar.gz: a1b3716a3b9bb396dd50e233f74a6ed55aaa36489ec5aa80508ed4c5646306a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45dfd49b4086d13457f904a5a7d99d26f2065b9f7ab1033e335f273f0bccc17542d6ae75194f26e84224002ebb569c41a54365c4e97e1eb799ef2d77a05eb73e
|
7
|
+
data.tar.gz: 2b1490c0232e5ba74b08565b9172d428d8578936cef764f443c80bf56619636c930df35ff30f6b1c2d44e8d368a960b5b709a5950dfde6e2e5540131dd714f34
|
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 avatar badge breadcrumb button card carousel collapsible dialog flash input pagination progress prose sheet skeleton switch table toggle
|
22
|
+
bin/rails generate css_zero:add accordion alert avatar badge breadcrumb button card carousel collapsible dialog flash input layouts pagination progress prose sheet skeleton switch table tabs toggle
|
23
23
|
```
|
24
24
|
|
25
25
|
### Requirements
|
@@ -52,7 +52,6 @@ If you are using [Sprockets](https://github.com/rails/sprockets) make sure to lo
|
|
52
52
|
*= require transform
|
53
53
|
*= require transition
|
54
54
|
*= require typography
|
55
|
-
*= require zindex
|
56
55
|
*= require_tree .
|
57
56
|
*= require_self
|
58
57
|
*= require zutilities
|
@@ -44,7 +44,6 @@ html:has(dialog:modal[open]) {
|
|
44
44
|
overflow: hidden;
|
45
45
|
}
|
46
46
|
|
47
|
-
|
48
47
|
/*
|
49
48
|
Inherit line-height from `html` so users can set them as a class directly on the `html` element.
|
50
49
|
*/
|
@@ -202,14 +201,6 @@ input:where([type='button'], [type='reset'], [type='submit']),
|
|
202
201
|
appearance: button;
|
203
202
|
}
|
204
203
|
|
205
|
-
/*
|
206
|
-
Revert padding block, it can be noticed in select with multiple.
|
207
|
-
*/
|
208
|
-
|
209
|
-
option {
|
210
|
-
padding-block: revert;
|
211
|
-
}
|
212
|
-
|
213
204
|
/*
|
214
205
|
Use the modern Firefox focus style for all focusable elements.
|
215
206
|
*/
|
@@ -303,14 +294,6 @@ textarea {
|
|
303
294
|
color: color-mix(in srgb, currentColor 50%, transparent); /* 2 */
|
304
295
|
}
|
305
296
|
|
306
|
-
/*
|
307
|
-
Make sure disabled buttons don't get the pointer cursor.
|
308
|
-
*/
|
309
|
-
|
310
|
-
:disabled {
|
311
|
-
cursor: default;
|
312
|
-
}
|
313
|
-
|
314
297
|
/*
|
315
298
|
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
|
316
299
|
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
|
@@ -352,7 +335,7 @@ turbo-frame {
|
|
352
335
|
*/
|
353
336
|
|
354
337
|
[hidden] {
|
355
|
-
display: none;
|
338
|
+
display: none !important;
|
356
339
|
}
|
357
340
|
|
358
341
|
/*
|
@@ -360,5 +343,5 @@ turbo-frame {
|
|
360
343
|
*/
|
361
344
|
|
362
345
|
[contents] {
|
363
|
-
display: contents;
|
346
|
+
display: contents !important;
|
364
347
|
}
|
@@ -106,27 +106,27 @@
|
|
106
106
|
/****************************************************************
|
107
107
|
* Opacity
|
108
108
|
* Utilities for applying backdrop opacity filters to an element.
|
109
|
-
* backdrop-filter: var(--
|
109
|
+
* backdrop-filter: var(--alpha-45);
|
110
110
|
*****************************************************************/
|
111
|
-
--
|
112
|
-
--
|
113
|
-
--
|
114
|
-
--
|
115
|
-
--
|
116
|
-
--
|
117
|
-
--
|
118
|
-
--
|
119
|
-
--
|
120
|
-
--
|
121
|
-
--
|
122
|
-
--
|
123
|
-
--
|
124
|
-
--
|
125
|
-
--
|
126
|
-
--
|
127
|
-
--
|
128
|
-
--
|
129
|
-
--
|
130
|
-
--
|
131
|
-
--
|
111
|
+
--alpha-0: opacity(0);
|
112
|
+
--alpha-5: opacity(0.05);
|
113
|
+
--alpha-10: opacity(0.1);
|
114
|
+
--alpha-15: opacity(0.15);
|
115
|
+
--alpha-20: opacity(0.2);
|
116
|
+
--alpha-25: opacity(0.25);
|
117
|
+
--alpha-30: opacity(0.3);
|
118
|
+
--alpha-35: opacity(0.35);
|
119
|
+
--alpha-40: opacity(0.4);
|
120
|
+
--alpha-45: opacity(0.45);
|
121
|
+
--alpha-50: opacity(0.5);
|
122
|
+
--alpha-55: opacity(0.55);
|
123
|
+
--alpha-60: opacity(0.6);
|
124
|
+
--alpha-65: opacity(0.65);
|
125
|
+
--alpha-70: opacity(0.7);
|
126
|
+
--alpha-75: opacity(0.75);
|
127
|
+
--alpha-80: opacity(0.8);
|
128
|
+
--alpha-85: opacity(0.85);
|
129
|
+
--alpha-90: opacity(0.9);
|
130
|
+
--alpha-95: opacity(0.95);
|
131
|
+
--alpha-100: opacity(1);
|
132
132
|
}
|
@@ -88,11 +88,7 @@
|
|
88
88
|
* Aspect Ratio
|
89
89
|
*****************************************************************/
|
90
90
|
--aspect-square: 1/1;
|
91
|
-
--aspect-landscape: 4/3;
|
92
|
-
--aspect-portrait: 3/4;
|
93
91
|
--aspect-widescreen: 16/9;
|
94
|
-
--aspect-ultrawide: 18/5;
|
95
|
-
--aspect-golden: 1.6180/1;
|
96
92
|
|
97
93
|
/****************************************************************
|
98
94
|
* Breakpoints
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/****************************************************************
|
3
3
|
* Scale
|
4
4
|
* Variables for scaling elements with transform.
|
5
|
-
* transform:
|
5
|
+
* transform: var(--scale-100);
|
6
6
|
*****************************************************************/
|
7
7
|
--scale-50: scale(0.50);
|
8
8
|
--scale-75: scale(0.75);
|
@@ -4,8 +4,8 @@
|
|
4
4
|
* Variables for controlling which CSS properties transition.
|
5
5
|
* transition-property: var(--transition);
|
6
6
|
*****************************************************************/
|
7
|
-
--transition:
|
8
|
-
--transition-colors: background-color, border-color, color, fill, stroke;
|
7
|
+
--transition: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, translate, scale, rotate, filter, backdrop-filter;
|
8
|
+
--transition-colors: color, background-color, border-color, text-decoration-color, fill, stroke;
|
9
9
|
|
10
10
|
/****************************************************************
|
11
11
|
* Transition Timing
|
@@ -24,9 +24,8 @@
|
|
24
24
|
/****************************************************************
|
25
25
|
* Transition Timing Function
|
26
26
|
* Variables for controlling the easing of CSS transitions.
|
27
|
-
* transition-timing-function: var(--ease-
|
27
|
+
* transition-timing-function: var(--ease-in);
|
28
28
|
*****************************************************************/
|
29
|
-
--ease-linear: linear;
|
30
29
|
--ease-in: cubic-bezier(0.4, 0, 1, 1);
|
31
30
|
--ease-out: cubic-bezier(0, 0, 0.2, 1);
|
32
31
|
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
@@ -28,37 +28,6 @@
|
|
28
28
|
.gap { column-gap: var(--column-gap, 1rem); row-gap: var(--row-gap, 1rem); }
|
29
29
|
.gap-sm { column-gap: 0.5rem; row-gap: 0.5rem; }
|
30
30
|
|
31
|
-
/****************************************************************
|
32
|
-
* Grid
|
33
|
-
*****************************************************************/
|
34
|
-
.grid { display: grid; }
|
35
|
-
|
36
|
-
.grid-cols-1 { grid-template-columns: var(--grid-1); }
|
37
|
-
.grid-cols-2 { grid-template-columns: var(--grid-2); }
|
38
|
-
.grid-cols-3 { grid-template-columns: var(--grid-3); }
|
39
|
-
.grid-cols-4 { grid-template-columns: var(--grid-4); }
|
40
|
-
.grid-cols-5 { grid-template-columns: var(--grid-5); }
|
41
|
-
.grid-cols-6 { grid-template-columns: var(--grid-6); }
|
42
|
-
.grid-cols-7 { grid-template-columns: var(--grid-7); }
|
43
|
-
.grid-cols-8 { grid-template-columns: var(--grid-8); }
|
44
|
-
.grid-cols-9 { grid-template-columns: var(--grid-9); }
|
45
|
-
.grid-cols-10 { grid-template-columns: var(--grid-10); }
|
46
|
-
.grid-cols-11 { grid-template-columns: var(--grid-11); }
|
47
|
-
.grid-cols-12 { grid-template-columns: var(--grid-12); }
|
48
|
-
|
49
|
-
.col-span-1 { grid-column: var(--span-1); }
|
50
|
-
.col-span-2 { grid-column: var(--span-2); }
|
51
|
-
.col-span-3 { grid-column: var(--span-3); }
|
52
|
-
.col-span-4 { grid-column: var(--span-4); }
|
53
|
-
.col-span-5 { grid-column: var(--span-5); }
|
54
|
-
.col-span-6 { grid-column: var(--span-6); }
|
55
|
-
.col-span-7 { grid-column: var(--span-7); }
|
56
|
-
.col-span-8 { grid-column: var(--span-8); }
|
57
|
-
.col-span-9 { grid-column: var(--span-9); }
|
58
|
-
.col-span-10 { grid-column: var(--span-10); }
|
59
|
-
.col-span-11 { grid-column: var(--span-11); }
|
60
|
-
.col-span-12 { grid-column: var(--span-12); }
|
61
|
-
|
62
31
|
/****************************************************************
|
63
32
|
* Text
|
64
33
|
*****************************************************************/
|
@@ -141,8 +110,12 @@
|
|
141
110
|
*****************************************************************/
|
142
111
|
.border-0 { border-width: 0; }
|
143
112
|
.border { border-width: var(--border-size, 1px); }
|
113
|
+
|
114
|
+
.border-b { border-block-width: var(--border-size, 1px); }
|
144
115
|
.border-bs { border-block-start-width: var(--border-size, 1px); }
|
145
116
|
.border-be { border-block-end-width: var(--border-size, 1px); }
|
117
|
+
|
118
|
+
.border-i { border-inline-width: var(--border-size, 1px); }
|
146
119
|
.border-is { border-inline-start-width: var(--border-size, 1px); }
|
147
120
|
.border-ie { border-inline-end-width: var(--border-size, 1px); }
|
148
121
|
|
@@ -151,6 +124,7 @@
|
|
151
124
|
|
152
125
|
.border-solid { border-style: solid; }
|
153
126
|
.border-dashed { border-style: dashed; }
|
127
|
+
.border-dotted { border-style: dotted; }
|
154
128
|
|
155
129
|
.rounded-none { border-radius: none; }
|
156
130
|
.rounded-sm { border-radius: var(--rounded-sm); }
|
@@ -186,6 +160,7 @@
|
|
186
160
|
|
187
161
|
.h-full { block-size: 100%; }
|
188
162
|
.w-full { inline-size: 100%; }
|
163
|
+
.w-min { inline-size: min-content; }
|
189
164
|
|
190
165
|
.overflow-x-auto { overflow-x: auto; scroll-snap-type: x mandatory; }
|
191
166
|
.overflow-y-auto { overflow-y: auto; scroll-snap-type: y mandatory; }
|
@@ -340,11 +315,10 @@
|
|
340
315
|
* Accessibility
|
341
316
|
*****************************************************************/
|
342
317
|
.sr-only {
|
343
|
-
|
344
|
-
|
345
|
-
|
318
|
+
block-size: 1px;
|
319
|
+
clip-path: inset(50%);
|
320
|
+
inline-size: 1px;
|
346
321
|
overflow: hidden;
|
347
|
-
|
322
|
+
position: absolute;
|
348
323
|
white-space: nowrap;
|
349
|
-
border-width: 0;
|
350
324
|
}
|
data/lib/css_zero/version.rb
CHANGED
@@ -2,7 +2,7 @@ Description:
|
|
2
2
|
This will add components into your project.
|
3
3
|
|
4
4
|
Components:
|
5
|
-
accordion alert avatar badge breadcrumb button card carousel collapsible dialog flash input pagination progress prose sheet skeleton switch table toggle
|
5
|
+
accordion alert avatar badge breadcrumb button card carousel collapsible dialog flash input layouts pagination progress prose sheet skeleton switch table tabs toggle
|
6
6
|
|
7
7
|
Example:
|
8
8
|
bin/rails generate css_zero:add [components...]
|
@@ -32,6 +32,8 @@ flash:
|
|
32
32
|
input:
|
33
33
|
- app/assets/stylesheets/input.css
|
34
34
|
- app/assets/images/select-arrow.svg
|
35
|
+
layouts:
|
36
|
+
- app/assets/stylesheets/layouts.css
|
35
37
|
pagination:
|
36
38
|
- app/assets/stylesheets/pagination.css
|
37
39
|
- app/assets/images/chevron-right.svg
|
@@ -51,5 +53,8 @@ switch:
|
|
51
53
|
- app/assets/stylesheets/switch.css
|
52
54
|
table:
|
53
55
|
- app/assets/stylesheets/table.css
|
56
|
+
tabs:
|
57
|
+
- app/assets/stylesheets/tabs.css
|
58
|
+
- app/javascript/controllers/tabs_controller.js
|
54
59
|
toggle:
|
55
60
|
- app/assets/stylesheets/toggle.css
|
@@ -1,10 +1,16 @@
|
|
1
1
|
:where(.accordion) {
|
2
2
|
details {
|
3
3
|
border-block-end-width: var(--border);
|
4
|
-
transition: padding var(--time-150) var(--ease-in-out);
|
5
4
|
|
6
|
-
|
7
|
-
|
5
|
+
&::details-content {
|
6
|
+
block-size: 0; overflow: hidden;
|
7
|
+
transition-behavior: allow-discrete;
|
8
|
+
transition-duration: var(--time-150);
|
9
|
+
transition-property: content-visibility height;
|
10
|
+
}
|
11
|
+
|
12
|
+
&[open]::details-content {
|
13
|
+
block-size: calc-size(auto);
|
8
14
|
}
|
9
15
|
|
10
16
|
&[open] summary::after {
|
@@ -40,7 +46,7 @@
|
|
40
46
|
content: "";
|
41
47
|
filter: var(--color-filter-text);
|
42
48
|
inline-size: var(--size-4);
|
43
|
-
transition: transform var(--time-200)
|
49
|
+
transition: transform var(--time-200);
|
44
50
|
}
|
45
51
|
}
|
46
52
|
}
|
@@ -10,7 +10,7 @@
|
|
10
10
|
font-weight: var(--font-medium);
|
11
11
|
gap: var(--size-2);
|
12
12
|
justify-content: center;
|
13
|
-
|
13
|
+
white-space: nowrap;
|
14
14
|
padding: var(--size-2) var(--size-4);
|
15
15
|
text-align: center;
|
16
16
|
|
@@ -60,25 +60,19 @@
|
|
60
60
|
--btn-icon-color: var(--color-filter-negative);
|
61
61
|
}
|
62
62
|
|
63
|
-
.btn--loading {
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
> * {
|
68
|
-
visibility: hidden;
|
69
|
-
}
|
63
|
+
[aria-busy] .btn--loading:disabled {
|
64
|
+
> * {
|
65
|
+
visibility: hidden;
|
66
|
+
}
|
70
67
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
margin-inline: auto;
|
81
|
-
position: absolute;
|
82
|
-
}
|
68
|
+
&::after {
|
69
|
+
animation: spin 1s linear infinite;
|
70
|
+
background-image: url("loader-circle.svg");
|
71
|
+
background-size: cover;
|
72
|
+
block-size: var(--size-4);
|
73
|
+
content: "";
|
74
|
+
filter: var(--btn-icon-color, var(--color-filter-text-reversed));
|
75
|
+
inline-size: var(--size-4);
|
76
|
+
position: absolute;
|
83
77
|
}
|
84
78
|
}
|
@@ -1,12 +1,16 @@
|
|
1
1
|
.input {
|
2
2
|
appearance: none;
|
3
3
|
background-color: var(--color-bg);
|
4
|
-
border
|
4
|
+
border: var(--border) solid var(--color-border);
|
5
5
|
border-radius: var(--rounded-md);
|
6
6
|
font-size: var(--text-sm);
|
7
7
|
inline-size: var(--size-full);
|
8
8
|
padding: var(--size-2) var(--size-3);
|
9
9
|
|
10
|
+
option {
|
11
|
+
padding-block: revert;
|
12
|
+
}
|
13
|
+
|
10
14
|
&:is(textarea):not([rows]) {
|
11
15
|
field-sizing: content;
|
12
16
|
max-block-size: calc(10lh + var(--size-6));
|
@@ -26,15 +30,6 @@
|
|
26
30
|
margin-inline-end: var(--size-2);
|
27
31
|
}
|
28
32
|
|
29
|
-
&:autofill {
|
30
|
-
-webkit-text-fill-color: var(--color-text);
|
31
|
-
-webkit-box-shadow: 0 0 0px 1000px var(--color-selected) inset;
|
32
|
-
}
|
33
|
-
|
34
|
-
&::placeholder {
|
35
|
-
color: var(--color-text-subtle);
|
36
|
-
}
|
37
|
-
|
38
33
|
&:user-invalid {
|
39
34
|
border-color: var(--color-negative);
|
40
35
|
}
|
@@ -49,16 +44,35 @@
|
|
49
44
|
}
|
50
45
|
}
|
51
46
|
|
52
|
-
|
53
|
-
|
47
|
+
/* Containers that act like (and contain) inputs */
|
48
|
+
.input--actor {
|
49
|
+
&:focus-within {
|
50
|
+
outline: var(--border-2) solid var(--color-selected-dark);
|
51
|
+
outline-offset: var(--border-2);
|
52
|
+
}
|
53
|
+
|
54
|
+
&:has(:-webkit-autofill) {
|
55
|
+
-webkit-text-fill-color: var(--color-text);
|
56
|
+
-webkit-box-shadow: 0 0 0px 1000px var(--color-selected) inset;
|
57
|
+
}
|
58
|
+
|
59
|
+
.input__character {
|
60
|
+
border: 0; inline-size: 100%; outline: 0;
|
61
|
+
}
|
54
62
|
}
|
55
63
|
|
64
|
+
/* Checkbox, radio, and range */
|
56
65
|
.checkbox, .radio {
|
57
66
|
accent-color: var(--color-primary);
|
58
67
|
transform: scale(1.15);
|
59
68
|
}
|
60
69
|
|
61
|
-
|
70
|
+
.range {
|
71
|
+
accent-color: var(--color-primary);
|
72
|
+
}
|
73
|
+
|
74
|
+
/* Styles that are shared between components */
|
75
|
+
:is(.input, .checkbox, .radio, .range) {
|
62
76
|
&:focus-visible {
|
63
77
|
outline: var(--border-2) solid var(--color-selected-dark);
|
64
78
|
outline-offset: var(--border-2);
|
@@ -0,0 +1,47 @@
|
|
1
|
+
.layout-sidebar {
|
2
|
+
display: grid;
|
3
|
+
grid-template-areas: "header header" "sidebar main";
|
4
|
+
grid-template-columns: var(--sidebar-width, 0) 1fr;
|
5
|
+
grid-template-rows: auto 1fr;
|
6
|
+
min-block-size: 100dvh;
|
7
|
+
|
8
|
+
@media (width >= 48rem) {
|
9
|
+
--sidebar-width: 220px;
|
10
|
+
}
|
11
|
+
|
12
|
+
@media (width >= 64rem) {
|
13
|
+
--sidebar-width: 280px;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
.layout-pancake {
|
18
|
+
display: grid;
|
19
|
+
grid-template-rows: auto 1fr auto;
|
20
|
+
min-block-size: 100dvh;
|
21
|
+
}
|
22
|
+
|
23
|
+
.layout-centered {
|
24
|
+
display: grid;
|
25
|
+
place-content: center;
|
26
|
+
min-block-size: 100dvh;
|
27
|
+
}
|
28
|
+
|
29
|
+
.container {
|
30
|
+
margin-inline: auto;
|
31
|
+
max-inline-size: var(--container-width, 64rem);
|
32
|
+
min-block-size: 100dvh;
|
33
|
+
}
|
34
|
+
|
35
|
+
/* Grid areas definition */
|
36
|
+
|
37
|
+
#header {
|
38
|
+
grid-area: header;
|
39
|
+
}
|
40
|
+
|
41
|
+
#sidebar {
|
42
|
+
grid-area: sidebar;
|
43
|
+
}
|
44
|
+
|
45
|
+
#main {
|
46
|
+
grid-area: main;
|
47
|
+
}
|
@@ -5,7 +5,7 @@
|
|
5
5
|
block-size: 100%;
|
6
6
|
color: var(--color-text);
|
7
7
|
inline-size: var(--size-3-4);
|
8
|
-
margin-inline
|
8
|
+
margin-inline: var(--sheet-margin);
|
9
9
|
max-block-size: none;
|
10
10
|
max-inline-size: var(--width-sm);
|
11
11
|
padding: var(--size-6);
|
@@ -15,7 +15,7 @@
|
|
15
15
|
}
|
16
16
|
|
17
17
|
/* Setup animation */
|
18
|
-
transform:
|
18
|
+
transform: var(--sheet-transform);
|
19
19
|
transition-behavior: allow-discrete;
|
20
20
|
transition-duration: var(--time-500);
|
21
21
|
transition-property: display, overlay, transform;
|
@@ -39,7 +39,7 @@
|
|
39
39
|
/* Out animation */
|
40
40
|
@starting-style {
|
41
41
|
&[open] {
|
42
|
-
transform:
|
42
|
+
transform: var(--sheet-transform);
|
43
43
|
}
|
44
44
|
|
45
45
|
&[open]::backdrop {
|
@@ -49,10 +49,19 @@
|
|
49
49
|
|
50
50
|
@media (width < 40rem) {
|
51
51
|
max-inline-size: none;
|
52
|
-
text-align: center;
|
53
52
|
}
|
54
53
|
}
|
55
54
|
|
55
|
+
.sheet--left {
|
56
|
+
--sheet-margin: 0 auto;
|
57
|
+
--sheet-transform: translateX(-100%);
|
58
|
+
}
|
59
|
+
|
60
|
+
.sheet--right {
|
61
|
+
--sheet-margin: auto 0;
|
62
|
+
--sheet-transform: translateX(100%);
|
63
|
+
}
|
64
|
+
|
56
65
|
.sheet__close {
|
57
66
|
inset-block-start: var(--size-4);
|
58
67
|
inset-inline-end: var(--size-4);
|
@@ -9,7 +9,6 @@
|
|
9
9
|
inline-size: var(--size-11);
|
10
10
|
transition-duration: var(--time-150);
|
11
11
|
transition-property: var(--transition-colors);
|
12
|
-
transition-timing-function: var(--ease-in-out);
|
13
12
|
|
14
13
|
&:checked {
|
15
14
|
background-color: var(--color-primary);
|
@@ -26,7 +25,7 @@
|
|
26
25
|
border-radius: var(--rounded-full);
|
27
26
|
content: "";
|
28
27
|
display: block;
|
29
|
-
transition: margin var(--time-150)
|
28
|
+
transition: margin var(--time-150);
|
30
29
|
}
|
31
30
|
|
32
31
|
&:focus-visible {
|
@@ -0,0 +1,24 @@
|
|
1
|
+
.tabs {
|
2
|
+
display: flex;
|
3
|
+
flex-direction: column;
|
4
|
+
gap: var(--size-2);
|
5
|
+
}
|
6
|
+
|
7
|
+
.tabs__list {
|
8
|
+
background-color: var(--color-border-light);
|
9
|
+
block-size: var(--size-10);
|
10
|
+
border-radius: var(--rounded-md);
|
11
|
+
color: var(--color-text-subtle);
|
12
|
+
display: inline-flex;
|
13
|
+
gap: var(--size-2);
|
14
|
+
padding: var(--size-1);
|
15
|
+
|
16
|
+
button {
|
17
|
+
inline-size: var(--size-full);
|
18
|
+
}
|
19
|
+
|
20
|
+
button[data-selected=true] {
|
21
|
+
--btn-background: var(--color-bg);
|
22
|
+
--btn-color: var(--color-text);
|
23
|
+
}
|
24
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
2
|
+
|
3
|
+
export default class extends Controller {
|
4
|
+
static targets = [ "button", "tab" ]
|
5
|
+
static values = { selected: String }
|
6
|
+
|
7
|
+
initialize() {
|
8
|
+
this.#showSelectedTab()
|
9
|
+
}
|
10
|
+
|
11
|
+
select(event) {
|
12
|
+
this.selectedValue = event.target.dataset.value
|
13
|
+
this.#showSelectedTab()
|
14
|
+
}
|
15
|
+
|
16
|
+
#showSelectedTab() {
|
17
|
+
this.buttonTargets.forEach(element => {
|
18
|
+
element.dataset.selected = element.dataset.value === this.selectedValue
|
19
|
+
})
|
20
|
+
|
21
|
+
this.tabTargets.forEach(element => {
|
22
|
+
element.hidden = element.dataset.value !== this.selectedValue
|
23
|
+
})
|
24
|
+
}
|
25
|
+
}
|
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.
|
4
|
+
version: 0.0.30
|
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-
|
11
|
+
date: 2024-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: lazaronixon@hotmail.com
|
@@ -24,14 +24,13 @@ files:
|
|
24
24
|
- app/assets/stylesheets/colors.css
|
25
25
|
- app/assets/stylesheets/effects.css
|
26
26
|
- app/assets/stylesheets/filters.css
|
27
|
-
- app/assets/stylesheets/grid.css
|
28
27
|
- app/assets/stylesheets/sizes.css
|
29
28
|
- app/assets/stylesheets/transform.css
|
30
29
|
- app/assets/stylesheets/transition.css
|
31
30
|
- app/assets/stylesheets/typography.css
|
32
|
-
- app/assets/stylesheets/zindex.css
|
33
31
|
- app/assets/stylesheets/zutilities.css
|
34
32
|
- app/helpers/dialog_helper.rb
|
33
|
+
- app/helpers/tabs_helper.rb
|
35
34
|
- lib/css-zero.rb
|
36
35
|
- lib/css_zero/engine.rb
|
37
36
|
- lib/css_zero/version.rb
|
@@ -59,6 +58,7 @@ files:
|
|
59
58
|
- lib/generators/css_zero/add/templates/app/assets/stylesheets/dialog.css
|
60
59
|
- lib/generators/css_zero/add/templates/app/assets/stylesheets/flash.css
|
61
60
|
- lib/generators/css_zero/add/templates/app/assets/stylesheets/input.css
|
61
|
+
- lib/generators/css_zero/add/templates/app/assets/stylesheets/layouts.css
|
62
62
|
- lib/generators/css_zero/add/templates/app/assets/stylesheets/pagination.css
|
63
63
|
- lib/generators/css_zero/add/templates/app/assets/stylesheets/progress.css
|
64
64
|
- lib/generators/css_zero/add/templates/app/assets/stylesheets/prose.css
|
@@ -66,11 +66,13 @@ files:
|
|
66
66
|
- lib/generators/css_zero/add/templates/app/assets/stylesheets/skeleton.css
|
67
67
|
- lib/generators/css_zero/add/templates/app/assets/stylesheets/switch.css
|
68
68
|
- lib/generators/css_zero/add/templates/app/assets/stylesheets/table.css
|
69
|
+
- lib/generators/css_zero/add/templates/app/assets/stylesheets/tabs.css
|
69
70
|
- lib/generators/css_zero/add/templates/app/assets/stylesheets/toggle.css
|
70
71
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/carousel_controller.js
|
71
72
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js
|
72
73
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_controller.js
|
73
74
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/element_removal_controller.js
|
75
|
+
- lib/generators/css_zero/add/templates/app/javascript/controllers/tabs_controller.js
|
74
76
|
- lib/generators/css_zero/install/USAGE
|
75
77
|
- lib/generators/css_zero/install/install_generator.rb
|
76
78
|
- lib/generators/css_zero/install/templates/app/assets/stylesheets/base.css
|
@@ -1,38 +0,0 @@
|
|
1
|
-
:root {
|
2
|
-
/****************************************************************
|
3
|
-
* Grid Template
|
4
|
-
* Variables for specifying the columns/rows in a grid layout.
|
5
|
-
* grid-template-columns|grid-template-rows: var(--grid-1);
|
6
|
-
*****************************************************************/
|
7
|
-
--grid-1: repeat(1, minmax(0, 1fr));
|
8
|
-
--grid-2: repeat(2, minmax(0, 1fr));
|
9
|
-
--grid-3: repeat(3, minmax(0, 1fr));
|
10
|
-
--grid-4: repeat(4, minmax(0, 1fr));
|
11
|
-
--grid-5: repeat(5, minmax(0, 1fr));
|
12
|
-
--grid-6: repeat(6, minmax(0, 1fr));
|
13
|
-
--grid-7: repeat(7, minmax(0, 1fr));
|
14
|
-
--grid-8: repeat(8, minmax(0, 1fr));
|
15
|
-
--grid-9: repeat(9, minmax(0, 1fr));
|
16
|
-
--grid-10: repeat(10, minmax(0, 1fr));
|
17
|
-
--grid-11: repeat(11, minmax(0, 1fr));
|
18
|
-
--grid-12: repeat(12, minmax(0, 1fr));
|
19
|
-
|
20
|
-
/****************************************************************
|
21
|
-
* Grid Start / End
|
22
|
-
* Variables for controlling how elements are sized and placed across grid columns/rows.
|
23
|
-
* grid-column|grid-row: var(--span-1);
|
24
|
-
*****************************************************************/
|
25
|
-
--span-1: span 1 / span 1;
|
26
|
-
--span-2: span 2 / span 2;
|
27
|
-
--span-3: span 3 / span 3;
|
28
|
-
--span-4: span 4 / span 4;
|
29
|
-
--span-5: span 5 / span 5;
|
30
|
-
--span-6: span 6 / span 6;
|
31
|
-
--span-7: span 7 / span 7;
|
32
|
-
--span-8: span 8 / span 8;
|
33
|
-
--span-9: span 9 / span 9;
|
34
|
-
--span-10: span 10 / span 10;
|
35
|
-
--span-11: span 11 / span 11;
|
36
|
-
--span-12: span 12 / span 12;
|
37
|
-
--span-full: 1 / -1;
|
38
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
/****************************************************************
|
2
|
-
* Z-Index
|
3
|
-
* Utilities for controlling the stack order of an element.
|
4
|
-
* z-index: var(--z-10);
|
5
|
-
*****************************************************************/
|
6
|
-
|
7
|
-
:root {
|
8
|
-
--z-10: 10;
|
9
|
-
--z-20: 20;
|
10
|
-
--z-30: 30;
|
11
|
-
--z-40: 40;
|
12
|
-
--z-50: 50;
|
13
|
-
}
|