@arbeidstilsynet/design-css 0.7.1 → 0.8.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/dist/src/header.css +36 -22
- package/dist/src/index.css +63 -38
- package/dist/src/lightdarkimage.css +44 -0
- package/package.json +2 -2
- package/dist/src/lightdarklogo.css +0 -40
package/dist/src/header.css
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
.at-header {
|
|
2
|
-
--at-header-max-width:
|
|
2
|
+
--at-header-max-width: 108rem;
|
|
3
3
|
box-sizing: border-box;
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
6
|
align-items: center;
|
|
7
7
|
width: 100%;
|
|
8
8
|
container-type: inline-size;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.at-header .ds-search {
|
|
13
|
-
align-self: self-start;
|
|
14
|
-
}
|
|
9
|
+
margin: var(--ds-size-7) 0 0 0;
|
|
10
|
+
padding: 0 1rem;
|
|
11
|
+
color: var(--ds-color-neutral-text-default);
|
|
15
12
|
|
|
16
|
-
/* disable visited color in both the navigation and dropdown menu */
|
|
13
|
+
/* disable visited color in both the navigation and dropdown menu */
|
|
14
|
+
}
|
|
17
15
|
|
|
18
16
|
.at-header .ds-link {
|
|
19
17
|
--dsc-link-color--visited: var(--dsc-link-color);
|
|
18
|
+
color: var(--ds-color-neutral-text-default);
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
.at-header .ds-link:has(.at-header__logo) {
|
|
23
|
-
color: var(--ds-color-text-default);
|
|
24
22
|
font-weight: var(--ds-font-weight-medium);
|
|
25
23
|
text-decoration: none;
|
|
26
24
|
line-height: var(--ds-line-height-sm);
|
|
@@ -59,7 +57,7 @@
|
|
|
59
57
|
}
|
|
60
58
|
|
|
61
59
|
.at-header__center:not(:first-child) {
|
|
62
|
-
margin-left: var(--ds-size-
|
|
60
|
+
margin-left: var(--ds-size-26);
|
|
63
61
|
}
|
|
64
62
|
|
|
65
63
|
.at-header__right {
|
|
@@ -67,12 +65,9 @@
|
|
|
67
65
|
margin-left: auto;
|
|
68
66
|
}
|
|
69
67
|
|
|
70
|
-
.at-
|
|
71
|
-
.at-header__link:not(:hover):not(:focus-visible)
|
|
72
|
-
.at-header__dropdown-controls .ds-link:not(:hover):not(:focus-visible),
|
|
73
|
-
.at-header__dropdown-trigger {
|
|
68
|
+
.at-header .ds-link:not(:hover):not(:focus-visible),
|
|
69
|
+
.at-header__link:not(:hover):not(:focus-visible) {
|
|
74
70
|
text-decoration-line: none;
|
|
75
|
-
color: var(--ds-color-neutral-text-default);
|
|
76
71
|
}
|
|
77
72
|
|
|
78
73
|
.at-header__logo {
|
|
@@ -81,6 +76,7 @@
|
|
|
81
76
|
|
|
82
77
|
.at-header__dropdown-trigger {
|
|
83
78
|
font-weight: var(--ds-font-weight-medium);
|
|
79
|
+
color: var(--ds-color-neutral-text-default);
|
|
84
80
|
}
|
|
85
81
|
|
|
86
82
|
.at-header__link {
|
|
@@ -91,6 +87,15 @@
|
|
|
91
87
|
font-weight: var(--ds-font-weight-semibold);
|
|
92
88
|
}
|
|
93
89
|
|
|
90
|
+
.at-header .ds-dropdown.at-header__dropdown-content {
|
|
91
|
+
padding: var(--ds-size-3) var(--ds-size-2);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:is(.at-header .ds-dropdown.at-header__dropdown-content) .ds-field:has(input[role="switch"]) {
|
|
95
|
+
color: var(--ds-color-neutral-text-default);
|
|
96
|
+
padding: var(--ds-size-2) var(--ds-size-4);
|
|
97
|
+
}
|
|
98
|
+
|
|
94
99
|
.at-header__dropdown-item-mobile {
|
|
95
100
|
display: none;
|
|
96
101
|
}
|
|
@@ -114,12 +119,12 @@
|
|
|
114
119
|
padding: var(--ds-size-2) var(--ds-size-4);
|
|
115
120
|
text-decoration: none;
|
|
116
121
|
width: 100%;
|
|
117
|
-
color: var(--ds-color-text-default);
|
|
122
|
+
color: var(--ds-color-neutral-text-default);
|
|
118
123
|
background: unset;
|
|
119
124
|
}
|
|
120
125
|
|
|
121
126
|
.at-header__menu-row:hover {
|
|
122
|
-
color: var(--ds-color-text-default);
|
|
127
|
+
color: var(--ds-color-neutral-text-default);
|
|
123
128
|
background: var(--ds-color-surface-tinted);
|
|
124
129
|
}
|
|
125
130
|
|
|
@@ -188,17 +193,24 @@
|
|
|
188
193
|
}
|
|
189
194
|
|
|
190
195
|
@media (max-width: 48rem) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
196
|
+
.at-header {
|
|
197
|
+
height: var(--ds-size-18);
|
|
198
|
+
margin: 0;
|
|
199
|
+
padding: var(--ds-size-2) var(--ds-size-4);
|
|
200
|
+
}
|
|
195
201
|
.at-header__container {
|
|
196
202
|
justify-content: space-between;
|
|
197
203
|
}
|
|
198
204
|
|
|
205
|
+
.ds-link:has(.at-header__left) {
|
|
206
|
+
height: 100%;
|
|
207
|
+
}
|
|
208
|
+
|
|
199
209
|
.at-header__left {
|
|
210
|
+
height: 100%;
|
|
200
211
|
margin-right: 0;
|
|
201
212
|
flex-shrink: 0;
|
|
213
|
+
align-items: flex-end;
|
|
202
214
|
}
|
|
203
215
|
|
|
204
216
|
.at-header__center {
|
|
@@ -222,6 +234,8 @@
|
|
|
222
234
|
/* Full-width dropdown overlay for mobile */
|
|
223
235
|
width: 100%;
|
|
224
236
|
max-width: 100%;
|
|
237
|
+
padding: calc(2 * var(--ds-size-3)) 0;
|
|
238
|
+
|
|
225
239
|
/* Hide box-shadow to avoid line between dropdown menu and header on mobile */
|
|
226
240
|
box-shadow: none;
|
|
227
241
|
border-top: 0;
|
|
@@ -237,7 +251,7 @@
|
|
|
237
251
|
}
|
|
238
252
|
|
|
239
253
|
.at-header__link {
|
|
240
|
-
color: var(--ds-color-text-default);
|
|
254
|
+
color: var(--ds-color-neutral-text-default);
|
|
241
255
|
font-weight: var(--ds-font-weight-regular);
|
|
242
256
|
width: 100%;
|
|
243
257
|
height: var(--ds-size-10);
|
package/dist/src/index.css
CHANGED
|
@@ -201,27 +201,25 @@
|
|
|
201
201
|
@layer at.components{
|
|
202
202
|
|
|
203
203
|
.at-header {
|
|
204
|
-
--at-header-max-width:
|
|
204
|
+
--at-header-max-width: 108rem;
|
|
205
205
|
box-sizing: border-box;
|
|
206
206
|
display: flex;
|
|
207
207
|
flex-direction: column;
|
|
208
208
|
align-items: center;
|
|
209
209
|
width: 100%;
|
|
210
210
|
container-type: inline-size;
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
.at-header .ds-search {
|
|
215
|
-
align-self: self-start;
|
|
216
|
-
}
|
|
211
|
+
margin: var(--ds-size-7) 0 0 0;
|
|
212
|
+
padding: 0 1rem;
|
|
213
|
+
color: var(--ds-color-neutral-text-default);
|
|
217
214
|
|
|
218
215
|
/* disable visited color in both the navigation and dropdown menu */
|
|
216
|
+
}
|
|
219
217
|
.at-header .ds-link {
|
|
220
218
|
--dsc-link-color--visited: var(--dsc-link-color);
|
|
219
|
+
color: var(--ds-color-neutral-text-default);
|
|
221
220
|
}
|
|
222
221
|
|
|
223
222
|
.at-header .ds-link:has(.at-header__logo) {
|
|
224
|
-
color: var(--ds-color-text-default);
|
|
225
223
|
font-weight: var(--ds-font-weight-medium);
|
|
226
224
|
text-decoration: none;
|
|
227
225
|
line-height: var(--ds-line-height-sm);
|
|
@@ -260,7 +258,7 @@
|
|
|
260
258
|
}
|
|
261
259
|
|
|
262
260
|
.at-header__center:not(:first-child) {
|
|
263
|
-
margin-left: var(--ds-size-
|
|
261
|
+
margin-left: var(--ds-size-26);
|
|
264
262
|
}
|
|
265
263
|
|
|
266
264
|
.at-header__right {
|
|
@@ -268,12 +266,9 @@
|
|
|
268
266
|
margin-left: auto;
|
|
269
267
|
}
|
|
270
268
|
|
|
271
|
-
.at-
|
|
272
|
-
.at-header__link:not(:hover):not(:focus-visible)
|
|
273
|
-
.at-header__dropdown-controls .ds-link:not(:hover):not(:focus-visible),
|
|
274
|
-
.at-header__dropdown-trigger {
|
|
269
|
+
.at-header .ds-link:not(:hover):not(:focus-visible),
|
|
270
|
+
.at-header__link:not(:hover):not(:focus-visible) {
|
|
275
271
|
text-decoration-line: none;
|
|
276
|
-
color: var(--ds-color-neutral-text-default);
|
|
277
272
|
}
|
|
278
273
|
|
|
279
274
|
.at-header__logo {
|
|
@@ -282,6 +277,7 @@
|
|
|
282
277
|
|
|
283
278
|
.at-header__dropdown-trigger {
|
|
284
279
|
font-weight: var(--ds-font-weight-medium);
|
|
280
|
+
color: var(--ds-color-neutral-text-default);
|
|
285
281
|
}
|
|
286
282
|
|
|
287
283
|
.at-header__link {
|
|
@@ -292,6 +288,15 @@
|
|
|
292
288
|
font-weight: var(--ds-font-weight-semibold);
|
|
293
289
|
}
|
|
294
290
|
|
|
291
|
+
.at-header .ds-dropdown.at-header__dropdown-content {
|
|
292
|
+
padding: var(--ds-size-3) var(--ds-size-2);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
:is(.at-header .ds-dropdown.at-header__dropdown-content) .ds-field:has(input[role="switch"]) {
|
|
296
|
+
color: var(--ds-color-neutral-text-default);
|
|
297
|
+
padding: var(--ds-size-2) var(--ds-size-4);
|
|
298
|
+
}
|
|
299
|
+
|
|
295
300
|
.at-header__dropdown-item-mobile {
|
|
296
301
|
display: none;
|
|
297
302
|
}
|
|
@@ -315,12 +320,12 @@
|
|
|
315
320
|
padding: var(--ds-size-2) var(--ds-size-4);
|
|
316
321
|
text-decoration: none;
|
|
317
322
|
width: 100%;
|
|
318
|
-
color: var(--ds-color-text-default);
|
|
323
|
+
color: var(--ds-color-neutral-text-default);
|
|
319
324
|
background: unset;
|
|
320
325
|
}
|
|
321
326
|
|
|
322
327
|
.at-header__menu-row:hover {
|
|
323
|
-
color: var(--ds-color-text-default);
|
|
328
|
+
color: var(--ds-color-neutral-text-default);
|
|
324
329
|
background: var(--ds-color-surface-tinted);
|
|
325
330
|
}
|
|
326
331
|
|
|
@@ -385,17 +390,24 @@
|
|
|
385
390
|
}
|
|
386
391
|
|
|
387
392
|
@media (max-width: 48rem) {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
393
|
+
.at-header {
|
|
394
|
+
height: var(--ds-size-18);
|
|
395
|
+
margin: 0;
|
|
396
|
+
padding: var(--ds-size-2) var(--ds-size-4);
|
|
397
|
+
}
|
|
392
398
|
.at-header__container {
|
|
393
399
|
justify-content: space-between;
|
|
394
400
|
}
|
|
395
401
|
|
|
402
|
+
.ds-link:has(.at-header__left) {
|
|
403
|
+
height: 100%;
|
|
404
|
+
}
|
|
405
|
+
|
|
396
406
|
.at-header__left {
|
|
407
|
+
height: 100%;
|
|
397
408
|
margin-right: 0;
|
|
398
409
|
flex-shrink: 0;
|
|
410
|
+
align-items: flex-end;
|
|
399
411
|
}
|
|
400
412
|
|
|
401
413
|
.at-header__center {
|
|
@@ -419,6 +431,8 @@
|
|
|
419
431
|
/* Full-width dropdown overlay for mobile */
|
|
420
432
|
width: 100%;
|
|
421
433
|
max-width: 100%;
|
|
434
|
+
padding: calc(2 * var(--ds-size-3)) 0;
|
|
435
|
+
|
|
422
436
|
/* Hide box-shadow to avoid line between dropdown menu and header on mobile */
|
|
423
437
|
box-shadow: none;
|
|
424
438
|
border-top: 0;
|
|
@@ -434,7 +448,7 @@
|
|
|
434
448
|
}
|
|
435
449
|
|
|
436
450
|
.at-header__link {
|
|
437
|
-
color: var(--ds-color-text-default);
|
|
451
|
+
color: var(--ds-color-neutral-text-default);
|
|
438
452
|
font-weight: var(--ds-font-weight-regular);
|
|
439
453
|
width: 100%;
|
|
440
454
|
height: var(--ds-size-10);
|
|
@@ -467,41 +481,52 @@
|
|
|
467
481
|
}
|
|
468
482
|
}}
|
|
469
483
|
@layer at.components{
|
|
470
|
-
|
|
471
|
-
.at-
|
|
472
|
-
display:
|
|
484
|
+
/* Default behavior - follows system preference */
|
|
485
|
+
.at-lightdarkimage-light {
|
|
486
|
+
display: revert;
|
|
473
487
|
}
|
|
474
|
-
|
|
475
|
-
.at-logo-dark {
|
|
488
|
+
.at-lightdarkimage-dark {
|
|
476
489
|
display: none;
|
|
477
490
|
}
|
|
478
491
|
|
|
479
|
-
|
|
480
|
-
|
|
492
|
+
@media (prefers-color-scheme: dark) {
|
|
493
|
+
.at-lightdarkimage-light {
|
|
494
|
+
display: none;
|
|
495
|
+
}
|
|
496
|
+
.at-lightdarkimage-dark {
|
|
497
|
+
display: revert;
|
|
498
|
+
}
|
|
481
499
|
}
|
|
482
|
-
|
|
500
|
+
|
|
501
|
+
/* Explicit light mode */
|
|
502
|
+
[data-color-scheme="light"] .at-lightdarkimage-light {
|
|
503
|
+
display: revert;
|
|
504
|
+
}
|
|
505
|
+
[data-color-scheme="light"] .at-lightdarkimage-dark {
|
|
483
506
|
display: none;
|
|
484
507
|
}
|
|
485
508
|
|
|
486
|
-
|
|
509
|
+
/* Explicit dark mode */
|
|
510
|
+
[data-color-scheme="dark"] .at-lightdarkimage-light {
|
|
487
511
|
display: none;
|
|
488
512
|
}
|
|
489
|
-
[data-color-scheme="dark"] .at-
|
|
490
|
-
display:
|
|
513
|
+
[data-color-scheme="dark"] .at-lightdarkimage-dark {
|
|
514
|
+
display: revert;
|
|
491
515
|
}
|
|
492
516
|
|
|
493
|
-
|
|
494
|
-
|
|
517
|
+
/* Auto mode - follows system preference */
|
|
518
|
+
[data-color-scheme="auto"] .at-lightdarkimage-light {
|
|
519
|
+
display: revert;
|
|
495
520
|
}
|
|
496
|
-
[data-color-scheme="auto"] .at-
|
|
521
|
+
[data-color-scheme="auto"] .at-lightdarkimage-dark {
|
|
497
522
|
display: none;
|
|
498
523
|
}
|
|
499
524
|
|
|
500
525
|
@media (prefers-color-scheme: dark) {
|
|
501
|
-
[data-color-scheme="auto"] .at-
|
|
526
|
+
[data-color-scheme="auto"] .at-lightdarkimage-light {
|
|
502
527
|
display: none;
|
|
503
528
|
}
|
|
504
|
-
[data-color-scheme="auto"] .at-
|
|
505
|
-
display:
|
|
529
|
+
[data-color-scheme="auto"] .at-lightdarkimage-dark {
|
|
530
|
+
display: revert;
|
|
506
531
|
}
|
|
507
532
|
}}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* Default behavior - follows system preference */
|
|
2
|
+
.at-lightdarkimage-light {
|
|
3
|
+
display: revert;
|
|
4
|
+
}
|
|
5
|
+
.at-lightdarkimage-dark {
|
|
6
|
+
display: none;
|
|
7
|
+
}
|
|
8
|
+
@media (prefers-color-scheme: dark) {
|
|
9
|
+
.at-lightdarkimage-light {
|
|
10
|
+
display: none;
|
|
11
|
+
}
|
|
12
|
+
.at-lightdarkimage-dark {
|
|
13
|
+
display: revert;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/* Explicit light mode */
|
|
17
|
+
[data-color-scheme="light"] .at-lightdarkimage-light {
|
|
18
|
+
display: revert;
|
|
19
|
+
}
|
|
20
|
+
[data-color-scheme="light"] .at-lightdarkimage-dark {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
/* Explicit dark mode */
|
|
24
|
+
[data-color-scheme="dark"] .at-lightdarkimage-light {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
[data-color-scheme="dark"] .at-lightdarkimage-dark {
|
|
28
|
+
display: revert;
|
|
29
|
+
}
|
|
30
|
+
/* Auto mode - follows system preference */
|
|
31
|
+
[data-color-scheme="auto"] .at-lightdarkimage-light {
|
|
32
|
+
display: revert;
|
|
33
|
+
}
|
|
34
|
+
[data-color-scheme="auto"] .at-lightdarkimage-dark {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
37
|
+
@media (prefers-color-scheme: dark) {
|
|
38
|
+
[data-color-scheme="auto"] .at-lightdarkimage-light {
|
|
39
|
+
display: none;
|
|
40
|
+
}
|
|
41
|
+
[data-color-scheme="auto"] .at-lightdarkimage-dark {
|
|
42
|
+
display: revert;
|
|
43
|
+
}
|
|
44
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbeidstilsynet/design-css",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "CSS for Designsystemet",
|
|
5
5
|
"author": "Arbeidstilsynet",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@digdir/designsystemet-css": "1.11.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@types/node": "24.10.
|
|
31
|
+
"@types/node": "24.10.13",
|
|
32
32
|
"autoprefixer": "10.4.24",
|
|
33
33
|
"cssnano": "7.1.2",
|
|
34
34
|
"del-cli": "7.0.0",
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
.at-logo-wrapper > .at-logo {
|
|
2
|
-
display: flex;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.at-logo-dark {
|
|
6
|
-
display: none;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
[data-color-scheme="light"] .at-logo-light {
|
|
10
|
-
display: flex;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
[data-color-scheme="light"] .at-logo-dark {
|
|
14
|
-
display: none;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
[data-color-scheme="dark"] .at-logo-light {
|
|
18
|
-
display: none;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
[data-color-scheme="dark"] .at-logo-dark {
|
|
22
|
-
display: flex;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
[data-color-scheme="auto"] .at-logo-light {
|
|
26
|
-
display: flex;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
[data-color-scheme="auto"] .at-logo-dark {
|
|
30
|
-
display: none;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@media (prefers-color-scheme: dark) {
|
|
34
|
-
[data-color-scheme="auto"] .at-logo-light {
|
|
35
|
-
display: none;
|
|
36
|
-
}
|
|
37
|
-
[data-color-scheme="auto"] .at-logo-dark {
|
|
38
|
-
display: flex;
|
|
39
|
-
}
|
|
40
|
-
}
|