accessible-kit 1.0.0
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/LICENSE +21 -0
- package/README.md +1038 -0
- package/package.json +81 -0
- package/src/README.md +2240 -0
- package/src/css/a11y-accordion.core.css +94 -0
- package/src/css/a11y-accordion.theme.css +246 -0
- package/src/css/a11y-dropdown.core.css +169 -0
- package/src/css/a11y-dropdown.theme.css +175 -0
- package/src/css/a11y-modal.core.css +136 -0
- package/src/css/a11y-modal.theme.css +218 -0
- package/src/css/a11y-offcanvas.core.css +122 -0
- package/src/css/a11y-offcanvas.theme.css +170 -0
- package/src/css/a11y-tabs.core.css +120 -0
- package/src/css/a11y-tabs.theme.css +312 -0
- package/src/js/a11y-accordion.js +447 -0
- package/src/js/a11y-dropdown.js +353 -0
- package/src/js/a11y-modal.js +290 -0
- package/src/js/a11y-offcanvas.js +298 -0
- package/src/js/a11y-tabs.js +336 -0
- package/src/js/index.js +46 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/* Accessible Modal - Core Styles */
|
|
2
|
+
/* Obsahuje iba logiku, positioning, layout a spravanie */
|
|
3
|
+
/* Pre vizualne nastavenia pouzite a11y-modal.theme.css */
|
|
4
|
+
|
|
5
|
+
/* Modal wrapper */
|
|
6
|
+
[data-modal] {
|
|
7
|
+
position: fixed;
|
|
8
|
+
top: 0;
|
|
9
|
+
left: 0;
|
|
10
|
+
right: 0;
|
|
11
|
+
bottom: 0;
|
|
12
|
+
z-index: 1000;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
visibility: hidden;
|
|
17
|
+
opacity: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
[data-modal][aria-hidden="false"] {
|
|
21
|
+
visibility: visible;
|
|
22
|
+
opacity: 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Modal dialog */
|
|
26
|
+
[data-modal-dialog] {
|
|
27
|
+
position: relative;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
max-height: 90vh;
|
|
31
|
+
max-width: 90vw;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
transform: scale(0.95);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
[data-modal][aria-hidden="false"] [data-modal-dialog] {
|
|
37
|
+
transform: scale(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Size variants */
|
|
41
|
+
[data-modal-dialog][data-size="sm"] {
|
|
42
|
+
width: 400px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
[data-modal-dialog][data-size="md"] {
|
|
46
|
+
width: 600px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
[data-modal-dialog][data-size="lg"] {
|
|
50
|
+
width: 800px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
[data-modal-dialog][data-size="fullscreen"] {
|
|
54
|
+
width: 100vw;
|
|
55
|
+
height: 100vh;
|
|
56
|
+
max-width: 100vw;
|
|
57
|
+
max-height: 100vh;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Modal header */
|
|
61
|
+
[data-modal-header] {
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
justify-content: space-between;
|
|
65
|
+
flex-shrink: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Modal body */
|
|
69
|
+
[data-modal-body] {
|
|
70
|
+
flex: 1;
|
|
71
|
+
overflow-y: auto;
|
|
72
|
+
-webkit-overflow-scrolling: touch;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Modal footer */
|
|
76
|
+
[data-modal-footer] {
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: flex-end;
|
|
80
|
+
flex-shrink: 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Close button */
|
|
84
|
+
[data-modal-close] {
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Backdrop */
|
|
90
|
+
[data-modal-backdrop] {
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: 0;
|
|
93
|
+
left: 0;
|
|
94
|
+
right: 0;
|
|
95
|
+
bottom: 0;
|
|
96
|
+
z-index: -1;
|
|
97
|
+
opacity: 0;
|
|
98
|
+
transition: opacity var(--a11y-modal-duration, 0.2s) var(--a11y-modal-easing, ease);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[data-modal][aria-hidden="false"] [data-modal-backdrop] {
|
|
102
|
+
opacity: 1;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* Body scroll lock */
|
|
106
|
+
body.modal-open {
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Focus trap */
|
|
111
|
+
[data-modal-dialog]:focus {
|
|
112
|
+
outline: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* Responsive */
|
|
116
|
+
@media (max-width: 640px) {
|
|
117
|
+
[data-modal-dialog] {
|
|
118
|
+
max-width: 95vw;
|
|
119
|
+
max-height: 95vh;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
[data-modal-dialog][data-size="sm"],
|
|
123
|
+
[data-modal-dialog][data-size="md"],
|
|
124
|
+
[data-modal-dialog][data-size="lg"] {
|
|
125
|
+
width: 95vw;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* Reduced motion support */
|
|
130
|
+
@media (prefers-reduced-motion: reduce) {
|
|
131
|
+
[data-modal],
|
|
132
|
+
[data-modal-dialog],
|
|
133
|
+
[data-modal-backdrop] {
|
|
134
|
+
transition: none !important;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/* Accessible Modal - Theme Styles */
|
|
2
|
+
/* Obsahuje vizualne nastavenia: farby, velkosti, bordery, radiusy, spacing */
|
|
3
|
+
/* Pre zmenu vzhladu upravte tento subor */
|
|
4
|
+
|
|
5
|
+
/* Modal wrapper */
|
|
6
|
+
[data-modal] {
|
|
7
|
+
padding: 1rem;
|
|
8
|
+
transition: opacity var(--a11y-modal-duration, 0.2s) var(--a11y-modal-easing, ease),
|
|
9
|
+
visibility var(--a11y-modal-duration, 0.2s) var(--a11y-modal-easing, ease);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* Modal dialog */
|
|
13
|
+
[data-modal-dialog] {
|
|
14
|
+
width: 600px;
|
|
15
|
+
background: #fff;
|
|
16
|
+
border-radius: 0.5rem;
|
|
17
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
|
|
18
|
+
0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
19
|
+
transition: transform var(--a11y-modal-duration, 0.2s) var(--a11y-modal-easing, ease);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* Modal header */
|
|
23
|
+
[data-modal-header] {
|
|
24
|
+
padding: 1.5rem;
|
|
25
|
+
border-bottom: 1px solid #e5e7eb;
|
|
26
|
+
gap: 1rem;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[data-modal-title] {
|
|
30
|
+
margin: 0;
|
|
31
|
+
font-size: 1.25rem;
|
|
32
|
+
font-weight: 600;
|
|
33
|
+
color: #111827;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Modal body */
|
|
37
|
+
[data-modal-body] {
|
|
38
|
+
padding: 1.5rem;
|
|
39
|
+
color: #374151;
|
|
40
|
+
line-height: 1.6;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Modal footer */
|
|
44
|
+
[data-modal-footer] {
|
|
45
|
+
padding: 1rem 1.5rem;
|
|
46
|
+
border-top: 1px solid #e5e7eb;
|
|
47
|
+
gap: 0.75rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Close button */
|
|
51
|
+
[data-modal-close] {
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
width: 2rem;
|
|
56
|
+
height: 2rem;
|
|
57
|
+
padding: 0;
|
|
58
|
+
background: transparent;
|
|
59
|
+
border: none;
|
|
60
|
+
border-radius: 0.25rem;
|
|
61
|
+
color: #6b7280;
|
|
62
|
+
font-size: 1.5rem;
|
|
63
|
+
line-height: 1;
|
|
64
|
+
transition: all 0.15s ease;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
[data-modal-close]:hover {
|
|
68
|
+
background: #f3f4f6;
|
|
69
|
+
color: #111827;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
[data-modal-close]:focus {
|
|
73
|
+
outline: 2px solid #3b82f6;
|
|
74
|
+
outline-offset: 2px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Backdrop */
|
|
78
|
+
[data-modal-backdrop] {
|
|
79
|
+
background: rgba(0, 0, 0, 0.5);
|
|
80
|
+
backdrop-filter: blur(4px);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Size variants */
|
|
84
|
+
[data-modal-dialog][data-modal-dialog][data-size="sm"] {
|
|
85
|
+
border-radius: 0.375rem;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[data-modal-dialog][data-modal-dialog][data-size="sm"] [data-modal-header],
|
|
89
|
+
[data-modal-dialog][data-modal-dialog][data-size="sm"] [data-modal-body],
|
|
90
|
+
[data-modal-dialog][data-modal-dialog][data-size="sm"] [data-modal-footer] {
|
|
91
|
+
padding: 1.25rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
[data-modal-dialog][data-modal-dialog][data-size="lg"] [data-modal-header],
|
|
95
|
+
[data-modal-dialog][data-modal-dialog][data-size="lg"] [data-modal-body] {
|
|
96
|
+
padding: 2rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
[data-modal-dialog][data-modal-dialog][data-size="fullscreen"] {
|
|
100
|
+
border-radius: 0;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Centered content variant */
|
|
104
|
+
[data-modal-body].modal__body--centered {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
text-align: center;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Scrollable body */
|
|
113
|
+
[data-modal-body]::-webkit-scrollbar {
|
|
114
|
+
width: 8px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
[data-modal-body]::-webkit-scrollbar-track {
|
|
118
|
+
background: #f3f4f6;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
[data-modal-body]::-webkit-scrollbar-thumb {
|
|
122
|
+
background: #d1d5db;
|
|
123
|
+
border-radius: 4px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
[data-modal-body]::-webkit-scrollbar-thumb:hover {
|
|
127
|
+
background: #9ca3af;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Responsive */
|
|
131
|
+
@media (max-width: 640px) {
|
|
132
|
+
[data-modal] {
|
|
133
|
+
padding: 0.5rem;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
[data-modal-dialog] {
|
|
137
|
+
border-radius: 0.5rem;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
[data-modal-header] {
|
|
141
|
+
padding: 1.25rem;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
[data-modal-body] {
|
|
145
|
+
padding: 1.25rem;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
[data-modal-footer] {
|
|
149
|
+
padding: 1rem 1.25rem;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* Dark mode */
|
|
154
|
+
@media (prefers-color-scheme: dark) {
|
|
155
|
+
[data-modal-dialog] {
|
|
156
|
+
background: #1f2937;
|
|
157
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5),
|
|
158
|
+
0 10px 10px -5px rgba(0, 0, 0, 0.3);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
[data-modal-header],
|
|
162
|
+
[data-modal-footer] {
|
|
163
|
+
border-color: #374151;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
[data-modal-title] {
|
|
167
|
+
color: #f9fafb;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
[data-modal-body] {
|
|
171
|
+
color: #e5e7eb;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
[data-modal-close] {
|
|
175
|
+
color: #9ca3af;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
[data-modal-close]:hover {
|
|
179
|
+
background: #374151;
|
|
180
|
+
color: #f9fafb;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
[data-modal-backdrop] {
|
|
184
|
+
background: rgba(0, 0, 0, 0.7);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
[data-modal-body]::-webkit-scrollbar-track {
|
|
188
|
+
background: #374151;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
[data-modal-body]::-webkit-scrollbar-thumb {
|
|
192
|
+
background: #4b5563;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
[data-modal-body]::-webkit-scrollbar-thumb:hover {
|
|
196
|
+
background: #6b7280;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* High contrast mode */
|
|
201
|
+
@media (prefers-contrast: high) {
|
|
202
|
+
[data-modal-dialog] {
|
|
203
|
+
border: 2px solid currentColor;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
[data-modal-close]:focus {
|
|
207
|
+
outline-width: 3px;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/* Reduced motion support */
|
|
212
|
+
@media (prefers-reduced-motion: reduce) {
|
|
213
|
+
[data-modal],
|
|
214
|
+
[data-modal-dialog],
|
|
215
|
+
[data-modal-close] {
|
|
216
|
+
transition: none !important;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/* Accessible Offcanvas - Core Styles */
|
|
2
|
+
/* Obsahuje iba logiku, positioning, layout a spravanie */
|
|
3
|
+
/* Pre vizualne nastavenia pouzite a11y-offcanvas.theme.css */
|
|
4
|
+
|
|
5
|
+
/* Offcanvas panel */
|
|
6
|
+
[data-offcanvas-panel] {
|
|
7
|
+
position: fixed;
|
|
8
|
+
z-index: 1000;
|
|
9
|
+
visibility: hidden;
|
|
10
|
+
overflow-y: auto;
|
|
11
|
+
-webkit-overflow-scrolling: touch;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
[data-offcanvas-panel][aria-hidden="false"] {
|
|
15
|
+
visibility: visible;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Position variants */
|
|
19
|
+
[data-offcanvas-panel][data-position="left"] {
|
|
20
|
+
top: 0;
|
|
21
|
+
left: 0;
|
|
22
|
+
bottom: 0;
|
|
23
|
+
transform: translateX(-100%);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[data-offcanvas-panel][data-position="left"][aria-hidden="false"] {
|
|
27
|
+
transform: translateX(0);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
[data-offcanvas-panel][data-position="right"] {
|
|
31
|
+
top: 0;
|
|
32
|
+
right: 0;
|
|
33
|
+
bottom: 0;
|
|
34
|
+
transform: translateX(100%);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[data-offcanvas-panel][data-position="right"][aria-hidden="false"] {
|
|
38
|
+
transform: translateX(0);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
[data-offcanvas-panel][data-position="top"] {
|
|
42
|
+
top: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
right: 0;
|
|
45
|
+
transform: translateY(-100%);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[data-offcanvas-panel][data-position="top"][aria-hidden="false"] {
|
|
49
|
+
transform: translateY(0);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[data-offcanvas-panel][data-position="bottom"] {
|
|
53
|
+
bottom: 0;
|
|
54
|
+
left: 0;
|
|
55
|
+
right: 0;
|
|
56
|
+
transform: translateY(100%);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
[data-offcanvas-panel][data-position="bottom"][aria-hidden="false"] {
|
|
60
|
+
transform: translateY(0);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Offcanvas header */
|
|
64
|
+
[data-offcanvas-header] {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
justify-content: space-between;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Offcanvas body */
|
|
71
|
+
[data-offcanvas-body] {
|
|
72
|
+
flex: 1;
|
|
73
|
+
overflow-y: auto;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Offcanvas footer */
|
|
77
|
+
[data-offcanvas-footer] {
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
justify-content: flex-end;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Close button */
|
|
84
|
+
[data-offcanvas-close] {
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Backdrop */
|
|
90
|
+
[data-offcanvas-backdrop] {
|
|
91
|
+
position: fixed;
|
|
92
|
+
top: 0;
|
|
93
|
+
left: 0;
|
|
94
|
+
right: 0;
|
|
95
|
+
bottom: 0;
|
|
96
|
+
z-index: 999;
|
|
97
|
+
visibility: hidden;
|
|
98
|
+
opacity: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[data-offcanvas-backdrop][aria-hidden="false"] {
|
|
102
|
+
visibility: visible;
|
|
103
|
+
opacity: 1;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* Body scroll lock */
|
|
107
|
+
body.offcanvas-open {
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Focus trap */
|
|
112
|
+
[data-offcanvas-panel]:focus {
|
|
113
|
+
outline: none;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* Reduced motion support */
|
|
117
|
+
@media (prefers-reduced-motion: reduce) {
|
|
118
|
+
[data-offcanvas-panel],
|
|
119
|
+
[data-offcanvas-backdrop] {
|
|
120
|
+
transition: none !important;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/* Accessible Offcanvas - Theme Styles */
|
|
2
|
+
/* Obsahuje vizualne nastavenia: farby, velkosti, bordery, radiusy, spacing */
|
|
3
|
+
/* Pre zmenu vzhladu upravte tento subor */
|
|
4
|
+
|
|
5
|
+
/* Offcanvas panel */
|
|
6
|
+
[data-offcanvas-panel] {
|
|
7
|
+
width: 320px;
|
|
8
|
+
max-width: 100%;
|
|
9
|
+
background: #fff;
|
|
10
|
+
box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
|
|
11
|
+
transition: transform var(--a11y-offcanvas-duration, 0.3s) var(--a11y-offcanvas-easing, ease),
|
|
12
|
+
visibility var(--a11y-offcanvas-duration, 0.3s) var(--a11y-offcanvas-easing, ease);
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Top and bottom offcanvas */
|
|
18
|
+
[data-offcanvas-panel].offcanvas--top,
|
|
19
|
+
[data-offcanvas-panel].offcanvas--bottom {
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: auto;
|
|
22
|
+
max-height: 50vh;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Offcanvas header */
|
|
26
|
+
[data-offcanvas-header] {
|
|
27
|
+
padding: 1.25rem 1.5rem;
|
|
28
|
+
border-bottom: 1px solid #e5e7eb;
|
|
29
|
+
gap: 1rem;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
[data-offcanvas-title] {
|
|
33
|
+
margin: 0;
|
|
34
|
+
font-size: 1.125rem;
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
color: #111827;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Offcanvas body */
|
|
40
|
+
[data-offcanvas-body] {
|
|
41
|
+
padding: 1.5rem;
|
|
42
|
+
color: #374151;
|
|
43
|
+
line-height: 1.6;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Offcanvas footer */
|
|
47
|
+
[data-offcanvas-footer] {
|
|
48
|
+
padding: 1rem 1.5rem;
|
|
49
|
+
border-top: 1px solid #e5e7eb;
|
|
50
|
+
gap: 0.75rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Close button */
|
|
54
|
+
[data-offcanvas-close] {
|
|
55
|
+
display: inline-flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
width: 2rem;
|
|
59
|
+
height: 2rem;
|
|
60
|
+
padding: 0;
|
|
61
|
+
background: transparent;
|
|
62
|
+
border: none;
|
|
63
|
+
border-radius: 0.25rem;
|
|
64
|
+
color: #6b7280;
|
|
65
|
+
font-size: 1.25rem;
|
|
66
|
+
line-height: 1;
|
|
67
|
+
transition: all 0.15s ease;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
[data-offcanvas-close]:hover {
|
|
71
|
+
background: #f3f4f6;
|
|
72
|
+
color: #111827;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
[data-offcanvas-close]:focus {
|
|
76
|
+
outline: 2px solid #3b82f6;
|
|
77
|
+
outline-offset: 2px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Backdrop */
|
|
81
|
+
[data-offcanvas-backdrop] {
|
|
82
|
+
background: rgba(0, 0, 0, 0.5);
|
|
83
|
+
transition: opacity var(--a11y-offcanvas-duration, 0.3s) var(--a11y-offcanvas-easing, ease),
|
|
84
|
+
visibility var(--a11y-offcanvas-duration, 0.3s) var(--a11y-offcanvas-easing, ease);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Wide variant */
|
|
88
|
+
[data-offcanvas-panel][data-offcanvas-panel][data-width="wide"] {
|
|
89
|
+
width: 480px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Full width variant (for top/bottom) */
|
|
93
|
+
[data-offcanvas-panel][data-offcanvas-panel][data-width="full"] {
|
|
94
|
+
max-height: 100vh;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* Responsive */
|
|
98
|
+
@media (max-width: 640px) {
|
|
99
|
+
[data-offcanvas-panel] {
|
|
100
|
+
width: 100%;
|
|
101
|
+
max-width: 85vw;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
[data-offcanvas-panel].offcanvas--left,
|
|
105
|
+
[data-offcanvas-panel].offcanvas--right {
|
|
106
|
+
width: 85vw;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[data-offcanvas-header] {
|
|
110
|
+
padding: 1rem 1.25rem;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
[data-offcanvas-body] {
|
|
114
|
+
padding: 1.25rem;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* Dark mode */
|
|
119
|
+
@media (prefers-color-scheme: dark) {
|
|
120
|
+
[data-offcanvas-panel] {
|
|
121
|
+
background: #1f2937;
|
|
122
|
+
box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
[data-offcanvas-header],
|
|
126
|
+
[data-offcanvas-footer] {
|
|
127
|
+
border-color: #374151;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
[data-offcanvas-title] {
|
|
131
|
+
color: #f9fafb;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
[data-offcanvas-body] {
|
|
135
|
+
color: #e5e7eb;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
[data-offcanvas-close] {
|
|
139
|
+
color: #9ca3af;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
[data-offcanvas-close]:hover {
|
|
143
|
+
background: #374151;
|
|
144
|
+
color: #f9fafb;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
[data-offcanvas-backdrop] {
|
|
148
|
+
background: rgba(0, 0, 0, 0.7);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* High contrast mode */
|
|
153
|
+
@media (prefers-contrast: high) {
|
|
154
|
+
[data-offcanvas-panel] {
|
|
155
|
+
border: 2px solid currentColor;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
[data-offcanvas-close]:focus {
|
|
159
|
+
outline-width: 3px;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Reduced motion support */
|
|
164
|
+
@media (prefers-reduced-motion: reduce) {
|
|
165
|
+
[data-offcanvas-panel],
|
|
166
|
+
[data-offcanvas-backdrop],
|
|
167
|
+
[data-offcanvas-close] {
|
|
168
|
+
transition: none !important;
|
|
169
|
+
}
|
|
170
|
+
}
|