@navikt/ds-css 8.7.0 → 8.8.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/CHANGELOG.md +12 -0
- package/dist/component/alert.css +24 -2
- package/dist/component/alert.min.css +1 -1
- package/dist/component/readmore.css +42 -45
- package/dist/component/readmore.min.css +1 -1
- package/dist/components.css +66 -47
- package/dist/components.min.css +1 -1
- package/dist/global/tokens.css +3 -3
- package/dist/global/tokens.min.css +1 -1
- package/dist/index.css +69 -50
- package/dist/index.min.css +1 -1
- package/package.json +2 -2
- package/src/alert.css +23 -2
- package/src/data-table.css +134 -32
- package/src/listbox.css +2 -2
- package/src/read-more.css +45 -37
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navikt/ds-css",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.8.0",
|
|
4
4
|
"description": "CSS for Nav Designsystem",
|
|
5
5
|
"author": "Aksel | Nav designsystem team",
|
|
6
6
|
"keywords": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"css:get-version": "node config/get-version.js"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@navikt/ds-tokens": "^8.
|
|
33
|
+
"@navikt/ds-tokens": "^8.8.0",
|
|
34
34
|
"browserslist": "^4.25.0",
|
|
35
35
|
"esbuild": "^0.27.2",
|
|
36
36
|
"fast-glob": "3.3.3",
|
package/src/alert.css
CHANGED
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
&[data-variant="strong"] {
|
|
120
|
-
outline:
|
|
121
|
-
outline-offset: -
|
|
120
|
+
outline: 2px solid var(--ax-border-default);
|
|
121
|
+
outline-offset: -2px;
|
|
122
122
|
|
|
123
123
|
&[data-color="neutral"] {
|
|
124
124
|
outline-color: var(--ax-border-strong);
|
|
@@ -192,3 +192,24 @@
|
|
|
192
192
|
color: var(--ax-text-neutral-contrast);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
+
|
|
196
|
+
.aksel-base-alert__message {
|
|
197
|
+
border-radius: var(--ax-radius-12);
|
|
198
|
+
height: fit-content;
|
|
199
|
+
outline: 1px solid var(--ax-border-default);
|
|
200
|
+
outline-offset: -1px;
|
|
201
|
+
background: var(--ax-bg-moderate);
|
|
202
|
+
color: var(--ax-text-default);
|
|
203
|
+
display: flex;
|
|
204
|
+
align-items: flex-start;
|
|
205
|
+
gap: var(--ax-space-8);
|
|
206
|
+
padding: var(--ax-space-12) var(--ax-space-16);
|
|
207
|
+
|
|
208
|
+
& > .aksel-base-alert__icon {
|
|
209
|
+
margin-top: var(--ax-space-2);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.aksel-base-alert[data-size="small"] & > .aksel-base-alert__icon {
|
|
213
|
+
margin-top: 0;
|
|
214
|
+
}
|
|
215
|
+
}
|
package/src/data-table.css
CHANGED
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
min-width: 100%;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
--__axc-data-table-density: var(--ax-space-16)
|
|
36
|
+
--__axc-data-table-density: var(--ax-space-16);
|
|
37
37
|
|
|
38
38
|
&[data-density="condensed"] {
|
|
39
|
-
--__axc-data-table-density: var(--ax-space-8)
|
|
39
|
+
--__axc-data-table-density: var(--ax-space-8);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
&[data-density="spacious"] {
|
|
43
|
-
--__axc-data-table-density: var(--ax-space-32)
|
|
43
|
+
--__axc-data-table-density: var(--ax-space-32);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
&[data-zebra-stripes="true"] {
|
|
@@ -118,6 +118,18 @@
|
|
|
118
118
|
.aksel-data-table__td {
|
|
119
119
|
/* border doesn't work on sticky thead when we have collapsed borders, so using box-shadow instead */
|
|
120
120
|
box-shadow: inset 1px 1px 0 0 var(--ax-border-neutral-subtle);
|
|
121
|
+
|
|
122
|
+
&[data-align="left"] {
|
|
123
|
+
text-align: left;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&[data-align="center"] {
|
|
127
|
+
text-align: center;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&[data-align="right"] {
|
|
131
|
+
text-align: right;
|
|
132
|
+
}
|
|
121
133
|
}
|
|
122
134
|
|
|
123
135
|
/* BORDER STYLING END */
|
|
@@ -128,10 +140,19 @@
|
|
|
128
140
|
color: var(--ax-text-neutral);
|
|
129
141
|
padding: var(--ax-space-8) var(--ax-space-16);
|
|
130
142
|
text-align: start;
|
|
143
|
+
font-weight: var(--ax-font-weight-bold);
|
|
144
|
+
|
|
145
|
+
&:has(.aksel-data-table__th-sort-button):hover {
|
|
146
|
+
background-color: var(--ax-bg-neutral-moderate-hover);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&:has(.aksel-data-table__th-sort-button):active {
|
|
150
|
+
background-color: var(--ax-bg-neutral-moderate-pressed);
|
|
151
|
+
}
|
|
131
152
|
|
|
132
153
|
&[data-sortable="true"] {
|
|
133
154
|
padding: 0;
|
|
134
|
-
block-size:
|
|
155
|
+
block-size: calc(var(--__axc-data-table-density) + 1.5rem);
|
|
135
156
|
}
|
|
136
157
|
}
|
|
137
158
|
|
|
@@ -140,35 +161,36 @@
|
|
|
140
161
|
align-items: center;
|
|
141
162
|
gap: var(--ax-space-2);
|
|
142
163
|
padding-inline-start: var(--ax-space-16);
|
|
143
|
-
block-size:
|
|
164
|
+
block-size: calc(var(--__axc-data-table-density) + 1.5rem);
|
|
144
165
|
width: 100%;
|
|
145
166
|
cursor: pointer;
|
|
146
167
|
text-align: start;
|
|
147
168
|
background-color: transparent;
|
|
148
169
|
border: none;
|
|
149
|
-
|
|
150
|
-
&:hover {
|
|
151
|
-
background-color: var(--ax-bg-neutral-moderate-hover);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
&:active {
|
|
155
|
-
background-color: var(--ax-bg-neutral-moderate-pressed);
|
|
156
|
-
}
|
|
170
|
+
font-weight: inherit;
|
|
157
171
|
|
|
158
172
|
&:focus-visible {
|
|
159
|
-
outline:
|
|
160
|
-
outline-offset: -2px;
|
|
173
|
+
outline: none;
|
|
161
174
|
}
|
|
162
175
|
}
|
|
163
176
|
|
|
164
177
|
.aksel-data-table__th-sort-icon {
|
|
165
178
|
flex-shrink: 0;
|
|
179
|
+
margin-left: auto;
|
|
166
180
|
|
|
167
181
|
&[data-sort-direction="none"] {
|
|
168
|
-
|
|
182
|
+
visibility: hidden;
|
|
169
183
|
}
|
|
170
184
|
|
|
171
185
|
.aksel-data-table__th-sort-button:is(:hover, :focus-visible, :focus-within) & {
|
|
186
|
+
visibility: visible;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.aksel-data-table[data-layout="fixed"] &[data-sort-direction="none"] {
|
|
190
|
+
display: none;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.aksel-data-table[data-layout="fixed"] .aksel-data-table__th-sort-button:is(:hover, :focus-visible, :focus-within) & {
|
|
172
194
|
display: block;
|
|
173
195
|
}
|
|
174
196
|
}
|
|
@@ -194,8 +216,8 @@
|
|
|
194
216
|
width: 19px; /* TODO: Violation of WCAG SC 2.5.8 Target Size? https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html */
|
|
195
217
|
|
|
196
218
|
&:focus-visible {
|
|
197
|
-
outline:
|
|
198
|
-
outline-offset: -
|
|
219
|
+
outline: 2px solid var(--ax-border-focus);
|
|
220
|
+
outline-offset: -4px;
|
|
199
221
|
border-radius: var(--ax-radius-8);
|
|
200
222
|
}
|
|
201
223
|
|
|
@@ -204,6 +226,11 @@
|
|
|
204
226
|
position: absolute;
|
|
205
227
|
inset-block: 0;
|
|
206
228
|
width: 3px;
|
|
229
|
+
height: 75%;
|
|
230
|
+
top: 50%;
|
|
231
|
+
transform: translateY(-50%);
|
|
232
|
+
border-radius: var(--ax-radius-full);
|
|
233
|
+
transition: background 50ms linear;
|
|
207
234
|
}
|
|
208
235
|
|
|
209
236
|
&:hover::after {
|
|
@@ -212,11 +239,11 @@
|
|
|
212
239
|
}
|
|
213
240
|
|
|
214
241
|
&:active::after,
|
|
215
|
-
&:focus::after {
|
|
242
|
+
&:focus-visible::after {
|
|
216
243
|
background: var(--ax-bg-strong-pressed);
|
|
217
244
|
}
|
|
218
245
|
|
|
219
|
-
.aksel-data-table__th:last-
|
|
246
|
+
.aksel-data-table__th:last-of-type & {
|
|
220
247
|
inset-inline-end: 0;
|
|
221
248
|
width: 15px;
|
|
222
249
|
|
|
@@ -280,7 +307,7 @@
|
|
|
280
307
|
color: var(--ax-text-neutral-subtle);
|
|
281
308
|
|
|
282
309
|
> div {
|
|
283
|
-
padding: var(--__axc-data-table-density);
|
|
310
|
+
padding-block: var(--__axc-data-table-density);
|
|
284
311
|
padding-inline: 1rem;
|
|
285
312
|
}
|
|
286
313
|
}
|
|
@@ -290,7 +317,9 @@
|
|
|
290
317
|
scroll-margin-block: var(--ax-space-0);
|
|
291
318
|
scroll-margin-inline: var(--ax-space-0);
|
|
292
319
|
|
|
293
|
-
&:focus-visible
|
|
320
|
+
&:focus-visible,
|
|
321
|
+
/* Focus instead of focus-visible so that effect of sort-icon staying isnt strange */
|
|
322
|
+
&:has(.aksel-data-table__th-sort-button:focus) {
|
|
294
323
|
outline: 2px solid var(--ax-border-focus);
|
|
295
324
|
outline-offset: -4px;
|
|
296
325
|
}
|
|
@@ -303,6 +332,7 @@
|
|
|
303
332
|
.aksel-data-table__filler-cell {
|
|
304
333
|
width: auto;
|
|
305
334
|
display: table-cell;
|
|
335
|
+
padding: 0;
|
|
306
336
|
}
|
|
307
337
|
|
|
308
338
|
.aksel-data-table__drag-and-drop-item {
|
|
@@ -315,7 +345,7 @@
|
|
|
315
345
|
}
|
|
316
346
|
|
|
317
347
|
&[data-keyboard-dragging="true"] {
|
|
318
|
-
.aksel-data-
|
|
348
|
+
.aksel-data-drag-and-drop__drag-handler__button {
|
|
319
349
|
outline: 2px solid var(--ax-border-focus);
|
|
320
350
|
outline-offset: -1px;
|
|
321
351
|
border-radius: var(--ax-radius-8);
|
|
@@ -327,10 +357,13 @@
|
|
|
327
357
|
}
|
|
328
358
|
}
|
|
329
359
|
|
|
330
|
-
.aksel-data-
|
|
360
|
+
.aksel-data-drag-and-drop__drag-handler__button {
|
|
331
361
|
cursor: grab;
|
|
332
362
|
height: 1.5rem;
|
|
333
363
|
position: relative;
|
|
364
|
+
background: transparent;
|
|
365
|
+
border: none;
|
|
366
|
+
padding: 0;
|
|
334
367
|
|
|
335
368
|
&:focus-visible {
|
|
336
369
|
outline: 2px solid var(--ax-border-focus);
|
|
@@ -339,17 +372,86 @@
|
|
|
339
372
|
}
|
|
340
373
|
}
|
|
341
374
|
|
|
342
|
-
.aksel-data-
|
|
343
|
-
position: absolute;
|
|
344
|
-
left: 50%;
|
|
345
|
-
transform: translate(-50%, -50%);
|
|
375
|
+
.aksel-data-drag-and-drop__drag-handler__arrow {
|
|
346
376
|
height: 1.2rem;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.aksel-data-drag-and-drop__drag-handler__alt {
|
|
380
|
+
position: relative;
|
|
381
|
+
|
|
382
|
+
.aksel-data-drag-and-drop__drag-handler__arrow {
|
|
383
|
+
position: absolute;
|
|
384
|
+
left: 50%;
|
|
385
|
+
transform: translate(-50%, -50%);
|
|
386
|
+
|
|
387
|
+
&[data-direction="up"] {
|
|
388
|
+
top: -10px;
|
|
389
|
+
}
|
|
347
390
|
|
|
348
|
-
|
|
349
|
-
|
|
391
|
+
&[data-direction="down"] {
|
|
392
|
+
bottom: calc(-100% - 6px);
|
|
393
|
+
}
|
|
350
394
|
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.aksel-data-table__empty-state {
|
|
398
|
+
display: grid;
|
|
399
|
+
place-content: center;
|
|
400
|
+
padding-block: var(--ax-space-32);
|
|
401
|
+
padding-inline: var(--ax-space-16);
|
|
402
|
+
text-align: center;
|
|
403
|
+
gap: var(--ax-space-8);
|
|
404
|
+
justify-items: center;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.aksel-data-table__loading-state {
|
|
408
|
+
display: grid;
|
|
409
|
+
place-content: center;
|
|
410
|
+
padding-block: var(--ax-space-32);
|
|
411
|
+
padding-inline: var(--ax-space-16);
|
|
412
|
+
text-align: center;
|
|
413
|
+
gap: var(--ax-space-8);
|
|
414
|
+
justify-items: center;
|
|
415
|
+
position: relative;
|
|
351
416
|
|
|
352
|
-
|
|
353
|
-
|
|
417
|
+
&::before {
|
|
418
|
+
content: "";
|
|
419
|
+
position: absolute;
|
|
420
|
+
inline-size: 100%;
|
|
421
|
+
block-size: 2px;
|
|
422
|
+
inset-block-start: -1px;
|
|
423
|
+
background-color: var(--ax-bg-strong);
|
|
424
|
+
animation: animateDataTableLoading 1s linear infinite;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
@keyframes animateDataTableLoading {
|
|
429
|
+
0% {
|
|
430
|
+
inset-inline-start: 0;
|
|
431
|
+
inline-size: 0;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
20% {
|
|
435
|
+
inset-inline-start: 0;
|
|
436
|
+
inline-size: 40%;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
80% {
|
|
440
|
+
inset-inline-start: 60%;
|
|
441
|
+
inline-size: 40%;
|
|
354
442
|
}
|
|
443
|
+
|
|
444
|
+
100% {
|
|
445
|
+
inset-inline-start: 100%;
|
|
446
|
+
inline-size: 0;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/* TODO: Look to handle "inline"-checkbox better than custom CSS-overrides in the future. */
|
|
451
|
+
.aksel-data-table tr .aksel-checkbox {
|
|
452
|
+
padding: 0;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.aksel-data-table tr .aksel-checkbox:focus-within::after {
|
|
456
|
+
inset: 0;
|
|
355
457
|
}
|
package/src/listbox.css
CHANGED
package/src/read-more.css
CHANGED
|
@@ -3,6 +3,41 @@
|
|
|
3
3
|
--__axc-read-more-pi-start: 0px;
|
|
4
4
|
--__axc-read-more-pi-end: var(--ax-space-4);
|
|
5
5
|
--__axc-read-more-pb: var(--ax-space-4);
|
|
6
|
+
|
|
7
|
+
&[data-variant="ghost"] {
|
|
8
|
+
--__axc-read-more-radius: var(--ax-radius-4);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&[data-variant="moderate"] {
|
|
12
|
+
--__axc-read-more-radius: calc((var(--__axc-read-more-pb) * 2 + var(--ax-font-line-height-large)) / 2);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.aksel-read-more--large {
|
|
17
|
+
--__axc-read-more-pb: var(--ax-space-12);
|
|
18
|
+
|
|
19
|
+
&[data-variant="moderate"] {
|
|
20
|
+
--__axc-read-more-pi-start: var(--ax-space-12);
|
|
21
|
+
--__axc-read-more-pi-end: var(--ax-space-24);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.aksel-read-more--medium {
|
|
26
|
+
&[data-variant="moderate"] {
|
|
27
|
+
--__axc-read-more-pi-start: var(--ax-space-8);
|
|
28
|
+
--__axc-read-more-pi-end: var(--ax-space-16);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.aksel-read-more--small {
|
|
33
|
+
--__axc-read-more-icon-size: 1.25rem;
|
|
34
|
+
--__axc-read-more-pb: var(--ax-space-2);
|
|
35
|
+
|
|
36
|
+
&[data-variant="moderate"] {
|
|
37
|
+
--__axc-read-more-pi-start: var(--ax-space-8);
|
|
38
|
+
--__axc-read-more-pi-end: var(--ax-space-16);
|
|
39
|
+
--__axc-read-more-radius: calc((var(--__axc-read-more-pb) * 2 + var(--ax-font-line-height-medium)) / 2);
|
|
40
|
+
}
|
|
6
41
|
}
|
|
7
42
|
|
|
8
43
|
/* ----------------------------- ReadMore Button ---------------------------- */
|
|
@@ -18,48 +53,27 @@
|
|
|
18
53
|
padding-inline: var(--__axc-read-more-pi-start) var(--__axc-read-more-pi-end);
|
|
19
54
|
padding-block: var(--__axc-read-more-pb);
|
|
20
55
|
text-align: start;
|
|
56
|
+
border-radius: var(--__axc-read-more-radius);
|
|
21
57
|
|
|
22
58
|
&:focus-visible {
|
|
23
59
|
outline: 3px solid var(--ax-border-focus);
|
|
24
60
|
outline-offset: 3px;
|
|
25
61
|
}
|
|
26
62
|
|
|
27
|
-
|
|
28
|
-
transform: rotateX(-180deg);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.aksel-read-more:is([data-volume="low"], :not([data-volume])) {
|
|
33
|
-
& .aksel-read-more__button {
|
|
34
|
-
border-radius: var(--ax-radius-4);
|
|
35
|
-
|
|
63
|
+
.aksel-read-more[data-variant="ghost"] & {
|
|
36
64
|
&:hover {
|
|
37
65
|
background-color: var(--ax-bg-neutral-moderate-hoverA);
|
|
38
66
|
}
|
|
39
67
|
}
|
|
40
|
-
}
|
|
41
68
|
|
|
42
|
-
.aksel-read-more[data-
|
|
43
|
-
& .aksel-read-more__button {
|
|
69
|
+
.aksel-read-more[data-variant="moderate"] & {
|
|
44
70
|
background-color: var(--ax-bg-moderate);
|
|
45
|
-
border-radius: var(--ax-radius-full);
|
|
46
71
|
|
|
47
72
|
&:hover {
|
|
48
|
-
background-color: var(--ax-bg-moderate-
|
|
73
|
+
background-color: var(--ax-bg-moderate-hover);
|
|
49
74
|
color: var(--ax-text-default);
|
|
50
75
|
}
|
|
51
76
|
}
|
|
52
|
-
|
|
53
|
-
&.aksel-read-more--large {
|
|
54
|
-
--__axc-read-more-pi-start: var(--ax-space-12);
|
|
55
|
-
--__axc-read-more-pi-end: var(--ax-space-24);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
&.aksel-read-more--small,
|
|
59
|
-
&.aksel-read-more--medium {
|
|
60
|
-
--__axc-read-more-pi-start: var(--ax-space-8);
|
|
61
|
-
--__axc-read-more-pi-end: var(--ax-space-16);
|
|
62
|
-
}
|
|
63
77
|
}
|
|
64
78
|
|
|
65
79
|
/* ---------------------------- ReadMore Content ---------------------------- */
|
|
@@ -70,7 +84,7 @@
|
|
|
70
84
|
margin-left: calc(var(--__axc-read-more-pi-start) + var(--__axc-read-more-icon-size) / 2 - 1px);
|
|
71
85
|
padding-left: calc(var(--__axc-read-more-icon-size) / 2 - 1px + var(--ax-space-4));
|
|
72
86
|
|
|
73
|
-
|
|
87
|
+
.aksel-read-more[data-state="closed"] & {
|
|
74
88
|
display: none;
|
|
75
89
|
}
|
|
76
90
|
}
|
|
@@ -78,20 +92,14 @@
|
|
|
78
92
|
.aksel-read-more__expand-icon {
|
|
79
93
|
font-size: var(--__axc-read-more-icon-size);
|
|
80
94
|
flex-shrink: 0;
|
|
81
|
-
transition: transform 100ms
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/* ----------------------------- ReadMore Sizes ----------------------------- */
|
|
85
|
-
.aksel-read-more--large {
|
|
86
|
-
--__axc-read-more-pb: var(--ax-space-12);
|
|
87
|
-
}
|
|
95
|
+
transition: transform 100ms ease-in-out;
|
|
88
96
|
|
|
89
|
-
.aksel-read-more
|
|
90
|
-
|
|
91
|
-
|
|
97
|
+
.aksel-read-more[data-state="open"] & {
|
|
98
|
+
transform: rotateX(-180deg);
|
|
99
|
+
}
|
|
92
100
|
}
|
|
93
101
|
|
|
94
|
-
/* -------------------------
|
|
102
|
+
/* ------------------------- high-contrast ------------------------- */
|
|
95
103
|
@media (forced-colors: active) {
|
|
96
104
|
.aksel-read-more__button {
|
|
97
105
|
background-color: ButtonFace;
|