@dsrc-cm/core 0.1.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/dist/dsrc.css +10743 -0
- package/dist/dsrc.min.css +1 -0
- package/package.json +44 -0
- package/src/base/print.css +404 -0
- package/src/base/reset.css +106 -0
- package/src/components/accordion/accordion.css +216 -0
- package/src/components/alert/alert.css +187 -0
- package/src/components/badge/badge.css +178 -0
- package/src/components/breadcrumb/breadcrumb.css +235 -0
- package/src/components/button/button.css +805 -0
- package/src/components/callout/callout.css +95 -0
- package/src/components/card/card.css +551 -0
- package/src/components/checkbox/checkbox.css +257 -0
- package/src/components/consent/consent.css +297 -0
- package/src/components/download/download.css +66 -0
- package/src/components/dropdown/dropdown.css +295 -0
- package/src/components/highlight/highlight.css +74 -0
- package/src/components/input/input.css +337 -0
- package/src/components/label/label.css +29 -0
- package/src/components/link/link.css +208 -0
- package/src/components/logo/logo.css +86 -0
- package/src/components/modal/modal.css +271 -0
- package/src/components/notice/notice.css +211 -0
- package/src/components/pagination/pagination.css +132 -0
- package/src/components/password/password.css +195 -0
- package/src/components/quote/quote.css +156 -0
- package/src/components/radio/radio.css +270 -0
- package/src/components/range/range.css +362 -0
- package/src/components/search/search.css +129 -0
- package/src/components/select/select.css +130 -0
- package/src/components/sidemenu/sidemenu.css +268 -0
- package/src/components/spinner/spinner.css +73 -0
- package/src/components/stepper/stepper.css +140 -0
- package/src/components/summary/summary.css +142 -0
- package/src/components/tab/tab.css +184 -0
- package/src/components/table/table.css +556 -0
- package/src/components/tag/tag.css +201 -0
- package/src/components/tile/tile.css +389 -0
- package/src/components/toggle/toggle.css +229 -0
- package/src/components/tooltip/tooltip.css +158 -0
- package/src/components/translate/translate.css +356 -0
- package/src/components/upload/upload.css +185 -0
- package/src/index.css +77 -0
- package/src/layout/bandeau/bandeau.css +44 -0
- package/src/layout/entete/entete.css +130 -0
- package/src/layout/footer/footer.css +107 -0
- package/src/layout/grid/grid.css +197 -0
- package/src/layout/hero/hero.css +86 -0
- package/src/layout/main/main.css +123 -0
- package/src/layout/navigation/navigation.css +206 -0
- package/src/utilities/utilities.css +430 -0
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSRC Print Stylesheet
|
|
3
|
+
*
|
|
4
|
+
* Feuille de styles d'impression pour les sites gouvernementaux.
|
|
5
|
+
* Les citoyens impriment regulierement des formulaires, procedures
|
|
6
|
+
* et documents officiels -- cette feuille garantit une mise en page
|
|
7
|
+
* claire, lisible et economique en encre.
|
|
8
|
+
*
|
|
9
|
+
* Organisation:
|
|
10
|
+
* 1. Configuration de page (@page)
|
|
11
|
+
* 2. Remise a zero generale (general print resets)
|
|
12
|
+
* 3. Liens -- affichage des URL
|
|
13
|
+
* 4. Controle de coupure de page (break control)
|
|
14
|
+
* 5. Masquage des elements non imprimables
|
|
15
|
+
* 6. En-tete (header) -- version imprimable
|
|
16
|
+
* 7. Pied de page (footer) -- version imprimable
|
|
17
|
+
* 8. Composants -- surcharges pour l'impression
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
@media print {
|
|
21
|
+
|
|
22
|
+
/* ============================================================
|
|
23
|
+
* 1. Configuration de page
|
|
24
|
+
* ============================================================ */
|
|
25
|
+
|
|
26
|
+
@page {
|
|
27
|
+
margin: 2cm;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* ============================================================
|
|
31
|
+
* 2. Remise a zero generale
|
|
32
|
+
* ============================================================ */
|
|
33
|
+
|
|
34
|
+
*,
|
|
35
|
+
*::before,
|
|
36
|
+
*::after {
|
|
37
|
+
background: transparent !important;
|
|
38
|
+
color: #000 !important;
|
|
39
|
+
box-shadow: none !important;
|
|
40
|
+
text-shadow: none !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
body {
|
|
44
|
+
font-size: 12pt;
|
|
45
|
+
line-height: 1.5;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* ============================================================
|
|
49
|
+
* 3. Liens -- affichage des URL
|
|
50
|
+
* ============================================================ */
|
|
51
|
+
|
|
52
|
+
a,
|
|
53
|
+
a:visited {
|
|
54
|
+
text-decoration: underline !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
a[href]::after {
|
|
58
|
+
content: " (" attr(href) ")";
|
|
59
|
+
font-size: 0.85em;
|
|
60
|
+
font-weight: normal;
|
|
61
|
+
word-break: break-all;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Ne pas afficher l'URL pour les ancres internes et les liens javascript */
|
|
65
|
+
a[href^="#"]::after,
|
|
66
|
+
a[href^="javascript"]::after {
|
|
67
|
+
content: "";
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Abbreviations */
|
|
71
|
+
abbr[title]::after {
|
|
72
|
+
content: " (" attr(title) ")";
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* ============================================================
|
|
76
|
+
* 4. Controle de coupure de page
|
|
77
|
+
* ============================================================ */
|
|
78
|
+
|
|
79
|
+
h1, h2, h3, h4, h5, h6 {
|
|
80
|
+
break-after: avoid;
|
|
81
|
+
orphans: 3;
|
|
82
|
+
widows: 3;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
p {
|
|
86
|
+
orphans: 3;
|
|
87
|
+
widows: 3;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
table, figure, img {
|
|
91
|
+
break-inside: avoid;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
img {
|
|
95
|
+
max-width: 100% !important;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
pre, blockquote {
|
|
99
|
+
break-inside: avoid;
|
|
100
|
+
border: 1px solid #999 !important;
|
|
101
|
+
page-break-inside: avoid;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* ============================================================
|
|
105
|
+
* 5. Masquage des elements non imprimables
|
|
106
|
+
* ============================================================ */
|
|
107
|
+
|
|
108
|
+
.dsrc-bandeau,
|
|
109
|
+
.dsrc-nav,
|
|
110
|
+
.dsrc-consent,
|
|
111
|
+
.dsrc-search,
|
|
112
|
+
.dsrc-nav__toggle,
|
|
113
|
+
.dsrc-translate,
|
|
114
|
+
.dsrc-dropdown__menu,
|
|
115
|
+
.dsrc-spinner {
|
|
116
|
+
display: none !important;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* ============================================================
|
|
120
|
+
* 6. En-tete (header) -- version imprimable
|
|
121
|
+
* ============================================================ */
|
|
122
|
+
|
|
123
|
+
.dsrc-entete {
|
|
124
|
+
border-bottom: 2px solid #000 !important;
|
|
125
|
+
padding-bottom: 0.5cm;
|
|
126
|
+
margin-bottom: 0.5cm;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.dsrc-entete__actions {
|
|
130
|
+
display: none !important;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.dsrc-entete__titre {
|
|
134
|
+
font-size: 14pt !important;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.dsrc-entete__sous-titre {
|
|
138
|
+
font-size: 10pt !important;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Le drapeau reste visible */
|
|
142
|
+
.dsrc-drapeau {
|
|
143
|
+
border: 1px solid #000 !important;
|
|
144
|
+
print-color-adjust: exact;
|
|
145
|
+
-webkit-print-color-adjust: exact;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.dsrc-drapeau__vert {
|
|
149
|
+
background-color: #007a33 !important;
|
|
150
|
+
print-color-adjust: exact;
|
|
151
|
+
-webkit-print-color-adjust: exact;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.dsrc-drapeau__rouge {
|
|
155
|
+
background-color: #ce1126 !important;
|
|
156
|
+
print-color-adjust: exact;
|
|
157
|
+
-webkit-print-color-adjust: exact;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.dsrc-drapeau__jaune {
|
|
161
|
+
background-color: #fcd116 !important;
|
|
162
|
+
print-color-adjust: exact;
|
|
163
|
+
-webkit-print-color-adjust: exact;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.dsrc-drapeau__etoile {
|
|
167
|
+
background-color: #fcd116 !important;
|
|
168
|
+
print-color-adjust: exact;
|
|
169
|
+
-webkit-print-color-adjust: exact;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* ============================================================
|
|
173
|
+
* 7. Pied de page (footer) -- version imprimable
|
|
174
|
+
* ============================================================ */
|
|
175
|
+
|
|
176
|
+
.dsrc-footer {
|
|
177
|
+
margin-top: 1cm !important;
|
|
178
|
+
padding: 0.5cm 0 0 !important;
|
|
179
|
+
border-top: 1px solid #000 !important;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.dsrc-footer__inner {
|
|
183
|
+
display: block !important;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.dsrc-footer__bloc {
|
|
187
|
+
margin-bottom: 0.25cm;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.dsrc-footer__bas {
|
|
191
|
+
border-top: none !important;
|
|
192
|
+
padding-top: 0.25cm !important;
|
|
193
|
+
font-size: 9pt !important;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.dsrc-footer__lien {
|
|
197
|
+
text-decoration: underline !important;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* ============================================================
|
|
201
|
+
* 8. Composants -- surcharges pour l'impression
|
|
202
|
+
* ============================================================ */
|
|
203
|
+
|
|
204
|
+
/* ---- Accordion : afficher tous les panneaux depiles ---- */
|
|
205
|
+
|
|
206
|
+
.dsrc-accordions-group {
|
|
207
|
+
border: none !important;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.dsrc-accordion {
|
|
211
|
+
border: none !important;
|
|
212
|
+
border-bottom: 1px solid #ccc !important;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.dsrc-collapse {
|
|
216
|
+
max-height: none !important;
|
|
217
|
+
overflow: visible !important;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.dsrc-accordion__body {
|
|
221
|
+
display: block !important;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.dsrc-accordion__btn {
|
|
225
|
+
font-weight: bold !important;
|
|
226
|
+
padding-left: 0 !important;
|
|
227
|
+
cursor: default !important;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.dsrc-accordion__btn::after {
|
|
231
|
+
display: none !important;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* ---- Table : bordures claires, pas de coupure ---- */
|
|
235
|
+
|
|
236
|
+
.dsrc-table__wrapper {
|
|
237
|
+
overflow: visible !important;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.dsrc-table__container {
|
|
241
|
+
overflow: visible !important;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.dsrc-table__container::before,
|
|
245
|
+
.dsrc-table__container::after {
|
|
246
|
+
display: none !important;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.dsrc-table table {
|
|
250
|
+
border-collapse: collapse !important;
|
|
251
|
+
width: 100% !important;
|
|
252
|
+
font-size: 10pt !important;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.dsrc-table th,
|
|
256
|
+
.dsrc-table td {
|
|
257
|
+
border: 1px solid #000 !important;
|
|
258
|
+
padding: 4pt 6pt !important;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.dsrc-table thead {
|
|
262
|
+
print-color-adjust: exact;
|
|
263
|
+
-webkit-print-color-adjust: exact;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.dsrc-table tr {
|
|
267
|
+
break-inside: avoid;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* ---- Card : bordures, pas d'ombres ---- */
|
|
271
|
+
|
|
272
|
+
.dsrc-card {
|
|
273
|
+
border: 1px solid #000 !important;
|
|
274
|
+
break-inside: avoid;
|
|
275
|
+
page-break-inside: avoid;
|
|
276
|
+
margin-bottom: 0.5cm;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.dsrc-card__header {
|
|
280
|
+
border-bottom: 1px solid #000 !important;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.dsrc-card__footer {
|
|
284
|
+
border-top: 1px solid #000 !important;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/* ---- Button : texte avec bordure ---- */
|
|
288
|
+
|
|
289
|
+
.dsrc-btn {
|
|
290
|
+
border: 1px solid #000 !important;
|
|
291
|
+
padding: 2pt 6pt !important;
|
|
292
|
+
font-size: 10pt !important;
|
|
293
|
+
text-decoration: none !important;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.dsrc-btn--loading::after {
|
|
297
|
+
display: none !important;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.dsrc-btn[href]::after {
|
|
301
|
+
content: "" !important;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/* ---- Alert, Notice : visibles avec bordure ---- */
|
|
305
|
+
|
|
306
|
+
.dsrc-alert {
|
|
307
|
+
border: 1px solid #000 !important;
|
|
308
|
+
border-left: 3px solid #000 !important;
|
|
309
|
+
padding: 8pt !important;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.dsrc-alert__close,
|
|
313
|
+
.dsrc-btn--close {
|
|
314
|
+
display: none !important;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.dsrc-notice {
|
|
318
|
+
border: 1px solid #000 !important;
|
|
319
|
+
padding: 8pt !important;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* ---- Badge : bordure, fond transparent ---- */
|
|
323
|
+
|
|
324
|
+
.dsrc-badge {
|
|
325
|
+
border: 1px solid #000 !important;
|
|
326
|
+
padding: 1pt 4pt !important;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/* ---- Formulaires : bordures visibles ---- */
|
|
330
|
+
|
|
331
|
+
input,
|
|
332
|
+
textarea,
|
|
333
|
+
select {
|
|
334
|
+
border: 1px solid #000 !important;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/* ---- Breadcrumb : simplifier ---- */
|
|
338
|
+
|
|
339
|
+
.dsrc-breadcrumb {
|
|
340
|
+
font-size: 9pt !important;
|
|
341
|
+
margin-bottom: 0.25cm;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.dsrc-breadcrumb__btn {
|
|
345
|
+
display: none !important;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.dsrc-breadcrumb .dsrc-collapse {
|
|
349
|
+
max-height: none !important;
|
|
350
|
+
overflow: visible !important;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/* ---- Tile ---- */
|
|
354
|
+
|
|
355
|
+
.dsrc-tile {
|
|
356
|
+
border: 1px solid #000 !important;
|
|
357
|
+
break-inside: avoid;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/* ---- Pagination : masquer ---- */
|
|
361
|
+
|
|
362
|
+
.dsrc-pagination {
|
|
363
|
+
display: none !important;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/* ---- Download : garder visible ---- */
|
|
367
|
+
|
|
368
|
+
.dsrc-download {
|
|
369
|
+
border: 1px solid #000 !important;
|
|
370
|
+
break-inside: avoid;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/* ---- Layout : pleine largeur ---- */
|
|
374
|
+
|
|
375
|
+
.dsrc-grid {
|
|
376
|
+
display: block !important;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.dsrc-grid > * {
|
|
380
|
+
width: 100% !important;
|
|
381
|
+
max-width: 100% !important;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.dsrc-main {
|
|
385
|
+
max-width: 100% !important;
|
|
386
|
+
padding: 0 !important;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/* ---- Utilitaire : classe pour forcer l'affichage/masquage ---- */
|
|
390
|
+
|
|
391
|
+
.dsrc-no-print {
|
|
392
|
+
display: none !important;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.dsrc-print-only {
|
|
396
|
+
display: block !important;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/* Masquer les elements reserves a l'impression en mode ecran */
|
|
402
|
+
.dsrc-print-only {
|
|
403
|
+
display: none;
|
|
404
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSRC CSS Reset
|
|
3
|
+
* Minimal reset focused on consistency
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* Accessibility: disable all motion for users who prefer reduced motion */
|
|
7
|
+
@media (prefers-reduced-motion: reduce) {
|
|
8
|
+
*,
|
|
9
|
+
*::before,
|
|
10
|
+
*::after {
|
|
11
|
+
animation-duration: 0.01ms !important;
|
|
12
|
+
animation-iteration-count: 1 !important;
|
|
13
|
+
transition-duration: 0.01ms !important;
|
|
14
|
+
scroll-behavior: auto !important;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
*,
|
|
19
|
+
*::before,
|
|
20
|
+
*::after {
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
margin: 0;
|
|
23
|
+
padding: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
html {
|
|
27
|
+
font-size: 16px;
|
|
28
|
+
-webkit-text-size-adjust: 100%;
|
|
29
|
+
-moz-tab-size: 4;
|
|
30
|
+
tab-size: 4;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
body {
|
|
34
|
+
font-family: var(--dsrc-font-family-sans);
|
|
35
|
+
font-size: var(--dsrc-font-size-body);
|
|
36
|
+
line-height: var(--dsrc-font-line-height-loose);
|
|
37
|
+
color: var(--dsrc-color-noir);
|
|
38
|
+
background-color: var(--dsrc-color-fond);
|
|
39
|
+
-webkit-font-smoothing: antialiased;
|
|
40
|
+
-moz-osx-font-smoothing: grayscale;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
a {
|
|
44
|
+
color: var(--dsrc-color-primaire);
|
|
45
|
+
text-decoration: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
a:hover {
|
|
49
|
+
text-decoration: underline;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
a:focus-visible {
|
|
53
|
+
outline: var(--dsrc-outline-width) solid var(--dsrc-color-primaire-focus);
|
|
54
|
+
outline-offset: var(--dsrc-outline-offset);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
img,
|
|
58
|
+
picture,
|
|
59
|
+
video,
|
|
60
|
+
canvas,
|
|
61
|
+
svg {
|
|
62
|
+
display: block;
|
|
63
|
+
max-width: 100%;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
button,
|
|
67
|
+
input,
|
|
68
|
+
select,
|
|
69
|
+
textarea {
|
|
70
|
+
font: inherit;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
h1, h2, h3, h4, h5, h6 {
|
|
74
|
+
font-weight: var(--dsrc-font-weight-bold);
|
|
75
|
+
line-height: var(--dsrc-font-line-height-snug);
|
|
76
|
+
color: var(--dsrc-color-noir);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
h1 { font-size: var(--dsrc-font-size-h1); line-height: var(--dsrc-font-line-height-tight); }
|
|
80
|
+
h2 { font-size: var(--dsrc-font-size-h2); }
|
|
81
|
+
h3 { font-size: var(--dsrc-font-size-h3); font-weight: var(--dsrc-font-weight-semibold); }
|
|
82
|
+
h4 { font-size: var(--dsrc-font-size-h4); font-weight: var(--dsrc-font-weight-semibold); }
|
|
83
|
+
|
|
84
|
+
code {
|
|
85
|
+
font-family: var(--dsrc-font-family-mono);
|
|
86
|
+
font-size: var(--dsrc-font-size-caption);
|
|
87
|
+
background: var(--dsrc-color-primaire-clair);
|
|
88
|
+
color: var(--dsrc-color-primaire-fonce);
|
|
89
|
+
padding: var(--dsrc-spacing-1) var(--dsrc-spacing-2);
|
|
90
|
+
border-radius: var(--dsrc-radius-small);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Skip to content - Accessibility */
|
|
94
|
+
.dsrc-skip-link {
|
|
95
|
+
position: absolute;
|
|
96
|
+
top: -100%;
|
|
97
|
+
left: 0;
|
|
98
|
+
background: var(--dsrc-color-primaire);
|
|
99
|
+
color: var(--dsrc-color-blanc);
|
|
100
|
+
padding: var(--dsrc-spacing-3) var(--dsrc-spacing-4);
|
|
101
|
+
z-index: var(--dsrc-z-index-skiplinks);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.dsrc-skip-link:focus {
|
|
105
|
+
top: 0;
|
|
106
|
+
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSRC Accordion Component
|
|
3
|
+
* Design Systeme de la Republique du Cameroun
|
|
4
|
+
*
|
|
5
|
+
* Architecture alignee sur le DSFR : l'ouverture/fermeture est
|
|
6
|
+
* pilotee par un <button> avec aria-expanded et un panneau
|
|
7
|
+
* collapsible (.dsrc-collapse), et non par <details>/<summary>.
|
|
8
|
+
*
|
|
9
|
+
* Structure HTML :
|
|
10
|
+
*
|
|
11
|
+
* <div class="dsrc-accordions-group">
|
|
12
|
+
* <section class="dsrc-accordion">
|
|
13
|
+
* <h3 class="dsrc-accordion__title">
|
|
14
|
+
* <button class="dsrc-accordion__btn"
|
|
15
|
+
* aria-expanded="false"
|
|
16
|
+
* aria-controls="accordion-1">
|
|
17
|
+
* Question ?
|
|
18
|
+
* </button>
|
|
19
|
+
* </h3>
|
|
20
|
+
* <div class="dsrc-collapse" id="accordion-1">
|
|
21
|
+
* <div class="dsrc-accordion__body">
|
|
22
|
+
* <p>Reponse...</p>
|
|
23
|
+
* </div>
|
|
24
|
+
* </div>
|
|
25
|
+
* </section>
|
|
26
|
+
* </div>
|
|
27
|
+
*
|
|
28
|
+
* Standalone (sans groupe) :
|
|
29
|
+
*
|
|
30
|
+
* <section class="dsrc-accordion">
|
|
31
|
+
* <h3 class="dsrc-accordion__title">...</h3>
|
|
32
|
+
* <div class="dsrc-collapse" id="...">...</div>
|
|
33
|
+
* </section>
|
|
34
|
+
*
|
|
35
|
+
* Le JS bascule aria-expanded et la classe dsrc-collapse--expanded.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
/* ==========================================================================
|
|
40
|
+
1. COLLAPSE MECHANISM
|
|
41
|
+
Composant generique de pliage/depliage anime.
|
|
42
|
+
========================================================================== */
|
|
43
|
+
|
|
44
|
+
.dsrc-collapse {
|
|
45
|
+
max-height: 0;
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
transition: max-height var(--dsrc-transition-duration-normal) ease;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.dsrc-collapse--expanded {
|
|
51
|
+
/* max-height est defini dynamiquement par JS (scrollHeight).
|
|
52
|
+
Fallback genereux si JS est desactive. */
|
|
53
|
+
max-height: var(--dsrc-collapse-max-height, 2000px);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
/* ==========================================================================
|
|
58
|
+
2. ACCORDION GROUP
|
|
59
|
+
Conteneur pour un ensemble d'accordeons.
|
|
60
|
+
========================================================================== */
|
|
61
|
+
|
|
62
|
+
.dsrc-accordions-group {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
border: var(--dsrc-border-width-thin) solid var(--dsrc-color-gris-200);
|
|
66
|
+
border-radius: var(--dsrc-radius-default);
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
/* ==========================================================================
|
|
72
|
+
3. SINGLE ACCORDION
|
|
73
|
+
Chaque section est separee par une bordure inferieure.
|
|
74
|
+
========================================================================== */
|
|
75
|
+
|
|
76
|
+
.dsrc-accordion {
|
|
77
|
+
border-bottom: var(--dsrc-border-width-thin) solid var(--dsrc-color-gris-200);
|
|
78
|
+
background-color: var(--dsrc-color-blanc);
|
|
79
|
+
font-family: var(--dsrc-font-family-sans);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.dsrc-accordions-group > .dsrc-accordion:last-child {
|
|
83
|
+
border-bottom: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Standalone accordion (sans groupe) */
|
|
87
|
+
.dsrc-accordion:not(.dsrc-accordions-group > .dsrc-accordion) {
|
|
88
|
+
border: var(--dsrc-border-width-thin) solid var(--dsrc-color-gris-200);
|
|
89
|
+
border-radius: var(--dsrc-radius-default);
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
/* ==========================================================================
|
|
95
|
+
4. ACCORDION TITLE (heading wrapper)
|
|
96
|
+
========================================================================== */
|
|
97
|
+
|
|
98
|
+
.dsrc-accordion__title {
|
|
99
|
+
margin: 0;
|
|
100
|
+
font-size: var(--dsrc-font-size-body);
|
|
101
|
+
line-height: var(--dsrc-font-line-height-normal);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
/* ==========================================================================
|
|
106
|
+
5. ACCORDION BUTTON (trigger)
|
|
107
|
+
========================================================================== */
|
|
108
|
+
|
|
109
|
+
.dsrc-accordion__btn {
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
justify-content: space-between;
|
|
113
|
+
width: 100%;
|
|
114
|
+
padding: var(--dsrc-spacing-4) var(--dsrc-spacing-5);
|
|
115
|
+
font-family: inherit;
|
|
116
|
+
font-size: inherit;
|
|
117
|
+
font-weight: var(--dsrc-font-weight-medium);
|
|
118
|
+
line-height: inherit;
|
|
119
|
+
color: var(--dsrc-color-noir);
|
|
120
|
+
background-color: transparent;
|
|
121
|
+
border: none;
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
text-align: start;
|
|
124
|
+
transition: background-color var(--dsrc-transition-duration-fast) ease;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* Chevron indicator */
|
|
128
|
+
.dsrc-accordion__btn::after {
|
|
129
|
+
content: '';
|
|
130
|
+
display: inline-block;
|
|
131
|
+
width: 10px;
|
|
132
|
+
height: 10px;
|
|
133
|
+
flex-shrink: 0;
|
|
134
|
+
margin-left: var(--dsrc-spacing-3);
|
|
135
|
+
border-right: 2px solid var(--dsrc-color-gris-600);
|
|
136
|
+
border-bottom: 2px solid var(--dsrc-color-gris-600);
|
|
137
|
+
transform: rotate(45deg);
|
|
138
|
+
transition: transform var(--dsrc-transition-duration-normal) ease;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Rotate chevron when expanded */
|
|
142
|
+
.dsrc-accordion__btn[aria-expanded="true"]::after {
|
|
143
|
+
transform: rotate(-135deg);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* Hover */
|
|
147
|
+
.dsrc-accordion__btn:hover {
|
|
148
|
+
background-color: var(--dsrc-color-gris-50);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Focus */
|
|
152
|
+
.dsrc-accordion__btn:focus-visible {
|
|
153
|
+
outline: var(--dsrc-outline-width) solid var(--dsrc-color-primaire-focus);
|
|
154
|
+
outline-offset: calc(-1 * var(--dsrc-outline-offset));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* Active */
|
|
158
|
+
.dsrc-accordion__btn:active {
|
|
159
|
+
background-color: var(--dsrc-color-gris-100);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
/* ==========================================================================
|
|
164
|
+
6. ACCORDION BODY (content inside collapse)
|
|
165
|
+
========================================================================== */
|
|
166
|
+
|
|
167
|
+
.dsrc-accordion__body {
|
|
168
|
+
padding: 0 var(--dsrc-spacing-5) var(--dsrc-spacing-5);
|
|
169
|
+
font-size: var(--dsrc-font-size-small);
|
|
170
|
+
color: var(--dsrc-color-gris-700);
|
|
171
|
+
line-height: var(--dsrc-font-line-height-loose);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
/* ==========================================================================
|
|
176
|
+
7. HIGH CONTRAST (forced-colors)
|
|
177
|
+
========================================================================== */
|
|
178
|
+
|
|
179
|
+
@media (forced-colors: active) {
|
|
180
|
+
.dsrc-accordions-group,
|
|
181
|
+
.dsrc-accordion:not(.dsrc-accordions-group > .dsrc-accordion) {
|
|
182
|
+
border: 1px solid ButtonText;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.dsrc-accordion {
|
|
186
|
+
border-bottom-color: ButtonText;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.dsrc-accordion__btn::after {
|
|
190
|
+
border-right-color: ButtonText;
|
|
191
|
+
border-bottom-color: ButtonText;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.dsrc-accordion__btn:focus-visible {
|
|
195
|
+
outline: 2px solid Highlight;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
/* ==========================================================================
|
|
201
|
+
8. REDUCED MOTION
|
|
202
|
+
========================================================================== */
|
|
203
|
+
|
|
204
|
+
@media (prefers-reduced-motion: reduce) {
|
|
205
|
+
.dsrc-collapse {
|
|
206
|
+
transition: none;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.dsrc-accordion__btn {
|
|
210
|
+
transition: none;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.dsrc-accordion__btn::after {
|
|
214
|
+
transition: none;
|
|
215
|
+
}
|
|
216
|
+
}
|