@natachah/vanilla-frontend 0.0.2
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.
- package/.gitlab-ci.yml +40 -0
- package/LICENSE.md +7 -0
- package/README.md +11 -0
- package/docs/index.html +36 -0
- package/docs/main.js +32 -0
- package/docs/pages/components/badge.html +154 -0
- package/docs/pages/components/button.html +186 -0
- package/docs/pages/components/card.html +184 -0
- package/docs/pages/components/dialog.html +334 -0
- package/docs/pages/components/disclosure.html +310 -0
- package/docs/pages/components/dropdown.html +255 -0
- package/docs/pages/components/form.html +331 -0
- package/docs/pages/components/list.html +140 -0
- package/docs/pages/components/loading.html +58 -0
- package/docs/pages/components/media.html +130 -0
- package/docs/pages/components/nav.html +119 -0
- package/docs/pages/components/progress.html +47 -0
- package/docs/pages/components/slider.html +311 -0
- package/docs/pages/components/table.html +168 -0
- package/docs/pages/javascript/autofill.html +170 -0
- package/docs/pages/javascript/checkall.html +59 -0
- package/docs/pages/javascript/comfort.html +134 -0
- package/docs/pages/javascript/consent.html +112 -0
- package/docs/pages/javascript/cookie.html +81 -0
- package/docs/pages/javascript/form.html +199 -0
- package/docs/pages/javascript/scroll.html +209 -0
- package/docs/pages/javascript/sidebar.html +53 -0
- package/docs/pages/javascript/sortable.html +148 -0
- package/docs/pages/javascript/toggle.html +191 -0
- package/docs/pages/javascript/tree.html +221 -0
- package/docs/pages/layout/grid.html +201 -0
- package/docs/pages/layout/reset.html +53 -0
- package/docs/pages/layout/typography.html +324 -0
- package/docs/pages/quick-start/conventions.html +112 -0
- package/docs/pages/quick-start/customization.html +187 -0
- package/docs/pages/quick-start/installation.html +95 -0
- package/docs/pages/quick-start/mixins.html +228 -0
- package/docs/pages/test.html +15 -0
- package/docs/src/js/demo.js +98 -0
- package/docs/src/js/doc-code.js +102 -0
- package/docs/src/js/doc-demo.js +14 -0
- package/docs/src/js/doc-layout.js +108 -0
- package/docs/src/scss/demo.scss +77 -0
- package/docs/src/scss/layout.scss +160 -0
- package/docs/src/scss/style.scss +278 -0
- package/docs/vite.config.mjs +23 -0
- package/esbuild.mjs +25 -0
- package/js/_autofill.js +131 -0
- package/js/_check-all.js +77 -0
- package/js/_comfort.js +174 -0
- package/js/_consent.js +84 -0
- package/js/_dialog.js +164 -0
- package/js/_dropdown.js +101 -0
- package/js/_scroll.js +184 -0
- package/js/_sidebar.js +97 -0
- package/js/_slider.js +249 -0
- package/js/_sortable.js +143 -0
- package/js/_tabpanel.js +88 -0
- package/js/_toggle.js +123 -0
- package/js/_tree.js +85 -0
- package/js/tests/autofill.test.js +157 -0
- package/js/tests/base-component.test.js +108 -0
- package/js/tests/check-all.test.js +88 -0
- package/js/tests/comfort.test.js +219 -0
- package/js/tests/consent.test.js +84 -0
- package/js/tests/cookie.test.js +102 -0
- package/js/tests/dialog.test.js +189 -0
- package/js/tests/dropdown.test.js +115 -0
- package/js/tests/form-helper.test.js +155 -0
- package/js/tests/scroll.test.js +203 -0
- package/js/tests/sidebar.test.js +99 -0
- package/js/tests/slider.test.js +307 -0
- package/js/tests/sortable.test.js +124 -0
- package/js/tests/tabpanel.test.js +114 -0
- package/js/tests/toggle.test.js +190 -0
- package/js/tests/tree.test.js +165 -0
- package/js/utilities/_base-component.js +101 -0
- package/js/utilities/_cookie.js +98 -0
- package/js/utilities/_error.js +80 -0
- package/js/utilities/_form-helper.js +101 -0
- package/package.json +42 -0
- package/scss/_badge.scss +37 -0
- package/scss/_button.scss +34 -0
- package/scss/_card.scss +122 -0
- package/scss/_dialog.scss +116 -0
- package/scss/_disclosure.scss +101 -0
- package/scss/_dropdown.scss +68 -0
- package/scss/_form.scss +197 -0
- package/scss/_grid.scss +40 -0
- package/scss/_group.scss +57 -0
- package/scss/_list.scss +18 -0
- package/scss/_loading.scss +49 -0
- package/scss/_media.scss +37 -0
- package/scss/_nav.scss +72 -0
- package/scss/_progress.scss +40 -0
- package/scss/_slider.scss +35 -0
- package/scss/_table.scss +36 -0
- package/scss/utilities/_mixin.scss +322 -0
- package/scss/utilities/_reset.scss +145 -0
- package/scss/utilities/_typography.scss +107 -0
- package/scss/vanilla-frontend.scss +23 -0
- package/scss/variables/_root.scss +70 -0
- package/scss/variables/_setting.scss +63 -0
- package/vitest.config.js +7 -0
package/scss/_form.scss
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// ------------------------------------------------------------------
|
|
3
|
+
/// Form
|
|
4
|
+
/// ------------------------------------------------------------------
|
|
5
|
+
/// Create the form components
|
|
6
|
+
///
|
|
7
|
+
/// @example <input>, <textarea> and <select>
|
|
8
|
+
///
|
|
9
|
+
/// @require {mixin} as-item
|
|
10
|
+
/// @group components
|
|
11
|
+
/// @author Natacha Herth
|
|
12
|
+
/// @since 1.0.0
|
|
13
|
+
///
|
|
14
|
+
////
|
|
15
|
+
|
|
16
|
+
label,
|
|
17
|
+
fieldset legend {
|
|
18
|
+
display: block;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
input,
|
|
22
|
+
textarea,
|
|
23
|
+
select {
|
|
24
|
+
|
|
25
|
+
// Customization
|
|
26
|
+
width: 100%;
|
|
27
|
+
vertical-align: middle;
|
|
28
|
+
|
|
29
|
+
// Define as an item
|
|
30
|
+
@include as-item('form', ('focus', 'disabled'));
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
textarea {
|
|
35
|
+
resize: vertical;
|
|
36
|
+
white-space: break-spaces;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[type=number] {
|
|
40
|
+
// Hide the default buttons
|
|
41
|
+
appearance: textfield;
|
|
42
|
+
|
|
43
|
+
&::-webkit-outer-spin-button,
|
|
44
|
+
&::-webkit-inner-spin-button {
|
|
45
|
+
-webkit-appearance: none;
|
|
46
|
+
margin: 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
[type=date],
|
|
51
|
+
[type=datetime-local],
|
|
52
|
+
[type=time],
|
|
53
|
+
[type=file],
|
|
54
|
+
select {
|
|
55
|
+
background-repeat: no-repeat;
|
|
56
|
+
background-size: 1rem;
|
|
57
|
+
background-position: calc(100% - var(--form-padding-inline, var(--padding-inline))) center;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
[type=date],
|
|
61
|
+
[type=datetime-local] {
|
|
62
|
+
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="black" viewBox="0 0 16 16"><path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"/></svg>');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
[type=time] {
|
|
66
|
+
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 d="M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z"/><path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm7-8A7 7 0 1 1 1 8a7 7 0 0 1 14 0z"/></svg>');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@-moz-document url-prefix() {
|
|
70
|
+
|
|
71
|
+
// For Firefox re-align icons (can't override the default)
|
|
72
|
+
[type=date],
|
|
73
|
+
[type=datetime-local],
|
|
74
|
+
[type=time] {
|
|
75
|
+
padding-right: .425rem;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// For Firefox don't add background-image (can't override the default)
|
|
79
|
+
[type=date],
|
|
80
|
+
[type=datetime-local] {
|
|
81
|
+
background-image: none;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
[type=file] {
|
|
87
|
+
|
|
88
|
+
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 d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"/><path d="M7.646 1.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 2.707V11.5a.5.5 0 0 1-1 0V2.707L5.354 4.854a.5.5 0 1 1-.708-.708l3-3z"/></svg>');
|
|
89
|
+
|
|
90
|
+
// Hide the default button, and make it look like a default input
|
|
91
|
+
&::file-selector-button {
|
|
92
|
+
visibility: hidden;
|
|
93
|
+
width: 0;
|
|
94
|
+
padding: 0;
|
|
95
|
+
margin: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
select {
|
|
101
|
+
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="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/></svg>');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
[type=color] {
|
|
105
|
+
height: calc((var(--font-size) * var(--line-height)) + (var(--form-padding-block, var(--padding-block)) * 2) + (var(--form-border-size, var(--border-size)) * 2));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
[type=range] {
|
|
109
|
+
|
|
110
|
+
$size: var(--range-size, 1rem);
|
|
111
|
+
|
|
112
|
+
@mixin as-range-button() {
|
|
113
|
+
background-color: var(--range-color, currentColor);
|
|
114
|
+
height: $size;
|
|
115
|
+
width: $size;
|
|
116
|
+
border: none;
|
|
117
|
+
border-radius: $size;
|
|
118
|
+
box-shadow: calc(-400px - $size / 2) 0 0 400px color-mix(in srgb, var(--range-color, currentColor), transparent 75%);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
padding: calc($size / 2) 0;
|
|
122
|
+
overflow: hidden;
|
|
123
|
+
height: $size;
|
|
124
|
+
border-radius: $size;
|
|
125
|
+
|
|
126
|
+
&::-moz-range-thumb {
|
|
127
|
+
@include as-range-button()
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&::-webkit-slider-thumb {
|
|
131
|
+
-webkit-appearance: none;
|
|
132
|
+
@include as-range-button()
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
[type=radio],
|
|
138
|
+
[type=checkbox],
|
|
139
|
+
[type=checkbox][role=switch] {
|
|
140
|
+
|
|
141
|
+
padding: 0;
|
|
142
|
+
width: 1.25rem;
|
|
143
|
+
height: 1.25rem;
|
|
144
|
+
background-repeat: no-repeat;
|
|
145
|
+
background-position: center;
|
|
146
|
+
|
|
147
|
+
&:checked {
|
|
148
|
+
background-color: var(--form-active-background, currentColor);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&:disabled:not(:checked) {
|
|
152
|
+
background-color: var(--form-background, rgba(black, 25%));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
& ~ label {
|
|
156
|
+
|
|
157
|
+
display: inline-block;
|
|
158
|
+
vertical-align: middle;
|
|
159
|
+
|
|
160
|
+
&:not(:last-of-type) {
|
|
161
|
+
margin-inline-end: var(--form-padding-inline, var(--padding-inline));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
[type=radio] {
|
|
168
|
+
|
|
169
|
+
border-radius: 100%;
|
|
170
|
+
|
|
171
|
+
&:checked {
|
|
172
|
+
background-size: 50%;
|
|
173
|
+
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" viewBox="0 0 16 16"><circle cx="8" cy="8" r="8"/></svg>');
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
[type=checkbox]:not([role=switch]):checked {
|
|
179
|
+
background-size: 100%;
|
|
180
|
+
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" viewBox="0 0 16 16"><path d="M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z"/></svg>');
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
[type=checkbox][role=switch] {
|
|
185
|
+
|
|
186
|
+
width: 2.25rem;
|
|
187
|
+
border-radius: 1rem;
|
|
188
|
+
background-position: .125em center;
|
|
189
|
+
background-size: auto calc(100% - .25em);
|
|
190
|
+
background-color: var(--form-background, rgba(black, 25%));
|
|
191
|
+
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" viewBox="0 0 16 16"><circle cx="8" cy="8" r="8"/></svg>');
|
|
192
|
+
|
|
193
|
+
&:checked {
|
|
194
|
+
background-position: calc(100% - .125em) center;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
}
|
package/scss/_grid.scss
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// ------------------------------------------------------------------
|
|
3
|
+
/// Grid
|
|
4
|
+
/// ------------------------------------------------------------------
|
|
5
|
+
/// Create the grid component
|
|
6
|
+
///
|
|
7
|
+
/// @example <div class="grid">...</div> or <div class="flex-grid">...</div>
|
|
8
|
+
///
|
|
9
|
+
/// @group components
|
|
10
|
+
/// @author Natacha Herth
|
|
11
|
+
/// @since 1.0.0
|
|
12
|
+
///
|
|
13
|
+
////
|
|
14
|
+
|
|
15
|
+
.grid,
|
|
16
|
+
.flex-grid {
|
|
17
|
+
|
|
18
|
+
gap: var(--grid-gap-block, 1rem) var(--grid-gap-inline, 1rem);
|
|
19
|
+
justify-content: var(--grid-justify, start);
|
|
20
|
+
align-items: var(--grid-align, initial);
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.grid {
|
|
25
|
+
display: grid;
|
|
26
|
+
grid-template-columns: repeat(var(--grid-columns, 12), minmax(0%, 1fr));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.flex-grid {
|
|
30
|
+
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
|
|
34
|
+
> * {
|
|
35
|
+
$column: var(--grid-columns, 12);
|
|
36
|
+
flex-basis: calc((1 / $column * 100%) - (var(--grid-gap-inline, 1rem) * ($column - 1) / $column));
|
|
37
|
+
flex-grow: var(--grid-grow, 0);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
}
|
package/scss/_group.scss
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// ------------------------------------------------------------------
|
|
3
|
+
/// Group
|
|
4
|
+
/// ------------------------------------------------------------------
|
|
5
|
+
/// Create the group component
|
|
6
|
+
///
|
|
7
|
+
/// @example <div class="group">...</div>
|
|
8
|
+
///
|
|
9
|
+
/// @group components
|
|
10
|
+
/// @author Natacha Herth
|
|
11
|
+
/// @since 1.0.0
|
|
12
|
+
///
|
|
13
|
+
////
|
|
14
|
+
|
|
15
|
+
.group {
|
|
16
|
+
|
|
17
|
+
display: flex;
|
|
18
|
+
|
|
19
|
+
> * {
|
|
20
|
+
|
|
21
|
+
&:is(label) {
|
|
22
|
+
@include as-item('form');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Remove extra border
|
|
26
|
+
& + *,
|
|
27
|
+
& + :is(.dropdown) > [aria-controls] {
|
|
28
|
+
border-left: none !important;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Remove extra radius
|
|
32
|
+
&:not(:first-child, :last-child),
|
|
33
|
+
&:not(:first-child, :last-child):is(.dropdown) > [aria-controls] {
|
|
34
|
+
border-radius: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:not(:only-child) {
|
|
38
|
+
|
|
39
|
+
// Remove radius right on first child
|
|
40
|
+
&:first-child,
|
|
41
|
+
&:first-child:is(.dropdown) > [aria-controls] {
|
|
42
|
+
border-start-end-radius: 0;
|
|
43
|
+
border-end-end-radius: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Remove radius left on last child
|
|
47
|
+
&:last-child,
|
|
48
|
+
&:last-child:is(.dropdown) > [aria-controls] {
|
|
49
|
+
border-start-start-radius: 0;
|
|
50
|
+
border-end-start-radius: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
}
|
package/scss/_list.scss
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// ------------------------------------------------------------------
|
|
3
|
+
/// List
|
|
4
|
+
/// ------------------------------------------------------------------
|
|
5
|
+
/// Create the list component
|
|
6
|
+
///
|
|
7
|
+
/// @example <ul class="list">...</ul>, <ol class="list">...</ol> or <div class="list">...</div>
|
|
8
|
+
///
|
|
9
|
+
/// @require {mixin} as-item
|
|
10
|
+
/// @group components
|
|
11
|
+
/// @author Natacha Herth
|
|
12
|
+
/// @since 1.0.0
|
|
13
|
+
///
|
|
14
|
+
////
|
|
15
|
+
|
|
16
|
+
.list {
|
|
17
|
+
@include as-list('list', ('focus', 'hover', 'active', 'disabled'), $properties)
|
|
18
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// ------------------------------------------------------------------
|
|
3
|
+
/// Loading
|
|
4
|
+
/// ------------------------------------------------------------------
|
|
5
|
+
/// Create the loading component
|
|
6
|
+
///
|
|
7
|
+
/// @example <div aria-busy="true">Busy</div>, <a href="#" aria-busy="true">Busy</a> or <button aria-busy="true">Busy</button>,
|
|
8
|
+
///
|
|
9
|
+
/// @group components
|
|
10
|
+
/// @author Natacha Herth
|
|
11
|
+
/// @since 1.0.0
|
|
12
|
+
///
|
|
13
|
+
////
|
|
14
|
+
|
|
15
|
+
[aria-busy=true] {
|
|
16
|
+
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
|
|
20
|
+
&::before {
|
|
21
|
+
content: "";
|
|
22
|
+
display: inline-block;
|
|
23
|
+
width: 1em;
|
|
24
|
+
height: 1em;
|
|
25
|
+
vertical-align: -.125em;
|
|
26
|
+
border: 2px solid currentColor;
|
|
27
|
+
border-radius: 1em;
|
|
28
|
+
border-right-color: transparent;
|
|
29
|
+
|
|
30
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
31
|
+
animation: busy-spinner 1s linear infinite;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:not(:empty)::before {
|
|
36
|
+
margin-inline-end: .5rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:empty {
|
|
40
|
+
text-align: center;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@keyframes busy-spinner {
|
|
44
|
+
to {
|
|
45
|
+
transform: rotate(360deg);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
}
|
package/scss/_media.scss
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// ------------------------------------------------------------------
|
|
3
|
+
/// Media
|
|
4
|
+
/// ------------------------------------------------------------------
|
|
5
|
+
/// Create the media component
|
|
6
|
+
///
|
|
7
|
+
/// @example <img>, <picture>, <figure>, <video> and <audio>
|
|
8
|
+
///
|
|
9
|
+
/// @group components
|
|
10
|
+
/// @author Natacha Herth
|
|
11
|
+
/// @since 1.0.0
|
|
12
|
+
///
|
|
13
|
+
////
|
|
14
|
+
|
|
15
|
+
img {
|
|
16
|
+
width: var(--image-width, auto);
|
|
17
|
+
height: var(--image-height, auto);
|
|
18
|
+
object-fit: var(--image-fit, cover);
|
|
19
|
+
aspect-ratio: var(--image-ratio, auto);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
video {
|
|
23
|
+
width: var(--video-width, 100%);
|
|
24
|
+
height: var(--video-height, auto);
|
|
25
|
+
object-fit: var(--video-fit, cover);
|
|
26
|
+
aspect-ratio: var(--video-ratio, 16/9);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
audio {
|
|
30
|
+
width: var(--audio-width, 100%);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
figcaption {
|
|
34
|
+
color: var(--caption-color, currentColor);
|
|
35
|
+
font-size: var(--caption-font-size, var(--font-size-small));
|
|
36
|
+
margin: var(--caption-margin-block, .5rem) var(--caption-margin-inline, 0);
|
|
37
|
+
}
|
package/scss/_nav.scss
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// ------------------------------------------------------------------
|
|
3
|
+
/// Nav
|
|
4
|
+
/// ------------------------------------------------------------------
|
|
5
|
+
/// Create the navigation component
|
|
6
|
+
///
|
|
7
|
+
/// @example <nav><ul>...</ul></nav> or <nav><ol>...</ol></nav>
|
|
8
|
+
///
|
|
9
|
+
/// @group components
|
|
10
|
+
/// @author Natacha Herth
|
|
11
|
+
/// @since 1.0.0
|
|
12
|
+
///
|
|
13
|
+
////
|
|
14
|
+
|
|
15
|
+
nav {
|
|
16
|
+
|
|
17
|
+
// Reset the list style
|
|
18
|
+
ul,
|
|
19
|
+
ol {
|
|
20
|
+
list-style: none;
|
|
21
|
+
padding: 0;
|
|
22
|
+
margin: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
ul {
|
|
26
|
+
|
|
27
|
+
// Design the nav list as inline by default
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: var(--nav-direction, row);
|
|
30
|
+
justify-content: var(--nav-justify, start);
|
|
31
|
+
align-items: var(--nav-align, center);
|
|
32
|
+
gap: var(--nav-gap, 1rem);
|
|
33
|
+
|
|
34
|
+
// Reset the anchor CSS properties
|
|
35
|
+
a {
|
|
36
|
+
--anchor-decoration: var(--nav-decoration, currentColor);
|
|
37
|
+
--anchor-color: var(--nav-color, currentColor);
|
|
38
|
+
--anchor-hover-color: var(--nav-hover-color, var(--nav-color, currentColor));
|
|
39
|
+
--anchor-active-color: var(--nav-active-color, var(--nav-hover-color, var(--nav-color, currentColor)));
|
|
40
|
+
--anchor-disabled-opacity: var(--nav-disabled-opacity, var(--disabled-opacity));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
ol {
|
|
46
|
+
|
|
47
|
+
// Design the breadcrumb list as inline by default
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: row;
|
|
50
|
+
justify-content: start;
|
|
51
|
+
align-items: center;
|
|
52
|
+
gap: 0;
|
|
53
|
+
|
|
54
|
+
// Add a divider between links
|
|
55
|
+
li:not(:last-child)::after {
|
|
56
|
+
content: var(--breadcrumb-divider, '/');
|
|
57
|
+
color: var(--breadcrumb-divider-color, currentColor);
|
|
58
|
+
margin-inline: var(--breadcrumb-gap, .5rem);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Reset the anchor CSS properties
|
|
62
|
+
a {
|
|
63
|
+
--anchor-decoration: var(--breadcrumb-decoration, currentColor);
|
|
64
|
+
--anchor-color: var(--breadcrumb-color, currentColor);
|
|
65
|
+
--anchor-hover-color: var(--breadcrumb-hover-color, var(--breadcrumb-color, currentColor));
|
|
66
|
+
--anchor-active-color: var(--breadcrumb-active-color, var(--breadcrumb-hover-color, var(--breadcrumb-color, currentColor)));
|
|
67
|
+
--anchor-disabled-opacity: var(--breadcrumb-disabled-opacity, var(--disabled-opacity));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// ------------------------------------------------------------------
|
|
3
|
+
/// Progress
|
|
4
|
+
/// ------------------------------------------------------------------
|
|
5
|
+
/// Create the progress bar component
|
|
6
|
+
///
|
|
7
|
+
/// @example <progress value="75" max="100"></progress>
|
|
8
|
+
///
|
|
9
|
+
/// @group components
|
|
10
|
+
/// @author Natacha Herth
|
|
11
|
+
/// @since 1.0.0
|
|
12
|
+
///
|
|
13
|
+
////
|
|
14
|
+
|
|
15
|
+
progress {
|
|
16
|
+
|
|
17
|
+
display: inline-block;
|
|
18
|
+
vertical-align: middle;
|
|
19
|
+
width: var(--progress-width, 100%);
|
|
20
|
+
height: var(--progress-height, 1rem);
|
|
21
|
+
background-color: var(--progress-background, color-mix(in srgb, var(--progress-color, currentColor), transparent 75%));
|
|
22
|
+
border-radius: var(--progress-border-radius, 1rem);
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
|
|
25
|
+
// Remove default background on Safari and Chrome
|
|
26
|
+
&::-webkit-progress-bar {
|
|
27
|
+
background: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Set the value bar background color on Safari & Chrome
|
|
31
|
+
&::-webkit-progress-value {
|
|
32
|
+
background-color: var(--progress-color, currentColor);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Set the value bar background color on Firefox
|
|
36
|
+
&::-moz-progress-bar {
|
|
37
|
+
background-color: var(--progress-color, currentColor);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// ------------------------------------------------------------------
|
|
3
|
+
/// Slider
|
|
4
|
+
/// ------------------------------------------------------------------
|
|
5
|
+
/// Create the slider component
|
|
6
|
+
///
|
|
7
|
+
/// @example <div class="slider">...</div>
|
|
8
|
+
///
|
|
9
|
+
/// @group components
|
|
10
|
+
/// @author Natacha Herth
|
|
11
|
+
/// @since 1.0.0
|
|
12
|
+
///
|
|
13
|
+
////
|
|
14
|
+
|
|
15
|
+
.slider {
|
|
16
|
+
|
|
17
|
+
position: relative; // Important for the offsetLeft
|
|
18
|
+
display: grid;
|
|
19
|
+
grid-auto-flow: column;
|
|
20
|
+
grid-auto-columns: calc((100% / var(--slider-columns, 1)) - var(--slider-gap, 0rem));
|
|
21
|
+
gap: var(--slider-gap, 0);
|
|
22
|
+
overscroll-behavior-inline: contain;
|
|
23
|
+
overflow-x: auto;
|
|
24
|
+
scroll-snap-type: inline mandatory;
|
|
25
|
+
|
|
26
|
+
// Remove Scrollbar
|
|
27
|
+
scrollbar-width: none;
|
|
28
|
+
-ms-overflow-style: none;
|
|
29
|
+
|
|
30
|
+
> * {
|
|
31
|
+
scroll-snap-align: start;
|
|
32
|
+
scroll-padding-inline: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
package/scss/_table.scss
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// ------------------------------------------------------------------
|
|
3
|
+
/// Table
|
|
4
|
+
/// ------------------------------------------------------------------
|
|
5
|
+
/// Create the table component
|
|
6
|
+
///
|
|
7
|
+
/// @example <table></table>
|
|
8
|
+
///
|
|
9
|
+
/// @group components
|
|
10
|
+
/// @author Natacha Herth
|
|
11
|
+
/// @since 1.0.0
|
|
12
|
+
///
|
|
13
|
+
////
|
|
14
|
+
|
|
15
|
+
table {
|
|
16
|
+
|
|
17
|
+
// Design the cells
|
|
18
|
+
th,
|
|
19
|
+
td {
|
|
20
|
+
padding: var(--table-padding-block, var(--padding-block)) var(--table-padding-inline, var(--padding-inline));
|
|
21
|
+
text-align: var(--table-align-inline, left);
|
|
22
|
+
vertical-align: var(--table-align-block, middle);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Add the borders
|
|
26
|
+
tr:not(:first-child) {
|
|
27
|
+
border-top: var(--table-border-size, var(--border-size)) var(--table-border-style, var(--border-style)) var(--table-border-color, transparent);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Change border between header & footer
|
|
31
|
+
thead + tbody > tr:first-child,
|
|
32
|
+
tfoot > tr:first-child {
|
|
33
|
+
border-top: var(--table-divider-size, var(--table-border-size, var(--border-size))) var(--table-divider-style, var(--table-border-style, var(--border-style))) var(--table-divider-color, var(--table-border-color, transparent));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
}
|