@digdir/designsystemet-css 0.4.0 → 0.6.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.
@@ -1,377 +1,3 @@
1
- @layer fds.utilities {
2
- /**
3
- * Visually hide an element, but leave it available for screen readers
4
- */
5
- .fds-utility-visuallyHidden-1ed11112 {
6
- border: 0;
7
- clip: rect(0 0 0 0);
8
- height: 1px;
9
- overflow: hidden;
10
- padding: 0;
11
- position: absolute;
12
- white-space: nowrap;
13
- width: 1px;
14
- }
15
-
16
- /**
17
- * Apply a focus outline on an element when it is focused with keyboard
18
- */
19
- .fds-utility-focusable-1ed11112:focus-visible {
20
- --fds-focus-border-width: 3px;
21
-
22
- outline: var(--fds-focus-border-width) solid var(--fds-semantic-border-focus-outline);
23
- outline-offset: var(--fds-focus-border-width);
24
- box-shadow: 0 0 0 var(--fds-focus-border-width) var(--fds-semantic-border-focus-boxshadow);
25
- }
26
- }
27
-
28
- @layer fds.button {
29
- .fds-button-button-8fa00f0f {
30
- --fc-button-padding: 0 var(--fds-spacing-4);
31
- --fc-button-color: var(--fds-semantic-text-action-first-on_action);
32
-
33
- display: flex;
34
- align-items: center;
35
- border: var(--fds-border_width-default) solid transparent;
36
- color: var(--fc-button-color);
37
- fill: var(--fc-button-color);
38
- min-width: 2.5em;
39
- padding: var(--fc-button-padding);
40
- box-sizing: border-box;
41
- cursor: pointer;
42
- font-family: inherit;
43
- justify-content: center;
44
- text-align: center;
45
- text-decoration: none;
46
- position: relative;
47
- border-radius: var(--fds-border_radius-interactive);
48
- min-height: var(--fds-sizing-10);
49
- }
50
-
51
- .fds-button-button-8fa00f0f svg {
52
- overflow: visible;
53
- }
54
-
55
- .fds-button-small-8fa00f0f::before {
56
- position: absolute;
57
- top: 0;
58
- left: 0;
59
- width: auto;
60
- min-height: auto;
61
- content: '';
62
- }
63
-
64
- .fds-button-small-8fa00f0f::after {
65
- position: absolute;
66
- top: -5px;
67
- left: 0;
68
- width: 100%;
69
- height: 44px;
70
- content: '';
71
- }
72
-
73
- .fds-button-button-8fa00f0f:disabled,
74
- .fds-button-button-8fa00f0f[aria-disabled='true'] {
75
- cursor: not-allowed;
76
- opacity: var(--fds-opacity-disabled);
77
- }
78
-
79
- .fds-button-small-8fa00f0f {
80
- --fc-button-padding: 0 var(--fds-spacing-3);
81
-
82
- gap: var(--fds-sizing-1);
83
- font: var(--fds-typography-paragraph-short-small);
84
- font-family: inherit;
85
- min-height: var(--fds-sizing-10);
86
- }
87
-
88
- .fds-button-medium-8fa00f0f {
89
- --fc-button-padding: 0 var(--fds-spacing-4);
90
-
91
- gap: var(--fds-sizing-2);
92
- font: var(--fds-typography-paragraph-short-medium);
93
- font-family: inherit;
94
- min-height: var(--fds-sizing-12);
95
- }
96
-
97
- .fds-button-large-8fa00f0f {
98
- --fc-button-padding: 0 var(--fds-spacing-5);
99
-
100
- gap: var(--fds-sizing-2);
101
- font: var(--fds-typography-paragraph-short-large);
102
- font-family: inherit;
103
- min-height: var(--fds-sizing-14);
104
- }
105
-
106
- .fds-button-fullWidth-8fa00f0f {
107
- width: 100%;
108
- }
109
-
110
- .fds-button-secondary-8fa00f0f,
111
- .fds-button-tertiary-8fa00f0f {
112
- background-color: transparent;
113
- }
114
-
115
- .fds-button-onlyIcon-8fa00f0f {
116
- --fc-button-padding: 0;
117
- }
118
-
119
- /* Only use hover for non-touch devices to prevent sticky-hovering */
120
- @media (hover: hover) and (pointer: fine) {
121
- .fds-button-primary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
122
- background-color: var(--fds-semantic-surface-action-first-hover);
123
- }
124
-
125
- .fds-button-primary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
126
- background-color: var(--fds-semantic-surface-action-second-hover);
127
- }
128
-
129
- .fds-button-primary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
130
- background-color: var(--fds-semantic-surface-success-hover);
131
- }
132
-
133
- .fds-button-primary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
134
- background-color: var(--fds-semantic-surface-danger-hover);
135
- }
136
-
137
- .fds-button-primary-8fa00f0f:where(.fds-button-inverted-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
138
- --fc-button-color: var(--fds-semantic-text-neutral-default);
139
-
140
- background-color: var(--fds-semantic-surface-on_inverted-hover);
141
- }
142
-
143
- .fds-button-secondary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
144
- --fc-button-color: var(--fds-semantic-text-action-first-hover);
145
-
146
- border-color: var(--fds-semantic-border-action-first-hover);
147
- background-color: var(--fds-semantic-surface-action-first-no_fill-hover);
148
- }
149
-
150
- .fds-button-secondary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
151
- --fc-button-color: var(--fds-semantic-text-action-second-hover);
152
-
153
- border-color: var(--fds-semantic-border-action-second-hover);
154
- background-color: var(--fds-semantic-surface-action-second-no_fill-hover);
155
- }
156
-
157
- .fds-button-secondary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
158
- --fc-button-color: var(--fds-semantic-text-success-hover);
159
-
160
- border-color: var(--fds-semantic-border-success-hover);
161
- background-color: var(--fds-semantic-surface-success-no_fill-hover);
162
- }
163
-
164
- .fds-button-secondary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
165
- --fc-button-color: var(--fds-semantic-text-danger-hover);
166
-
167
- border-color: var(--fds-semantic-border-danger-hover);
168
- background-color: var(--fds-semantic-surface-danger-no_fill-hover);
169
- }
170
-
171
- .fds-button-secondary-8fa00f0f:where(.fds-button-inverted-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
172
- background-color: var(--fds-semantic-surface-on_inverted-no_fill-hover);
173
- }
174
-
175
- .fds-button-tertiary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
176
- --fc-button-color: var(--fds-semantic-text-action-first-hover);
177
-
178
- background-color: var(--fds-semantic-surface-action-first-no_fill-hover);
179
- }
180
-
181
- .fds-button-tertiary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
182
- --fc-button-color: var(--fds-semantic-text-action-second-hover);
183
-
184
- background-color: var(--fds-semantic-surface-action-second-no_fill-hover);
185
- }
186
-
187
- .fds-button-tertiary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
188
- --fc-button-color: var(--fds-semantic-text-success-hover);
189
-
190
- background-color: var(--fds-semantic-surface-success-no_fill-hover);
191
- }
192
-
193
- .fds-button-tertiary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
194
- --fc-button-color: var(--fds-semantic-text-danger-hover);
195
-
196
- background-color: var(--fds-semantic-surface-danger-no_fill-hover);
197
- }
198
-
199
- .fds-button-tertiary-8fa00f0f:where(.fds-button-inverted-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
200
- --fc-button-color: var(--fds-semantic-text-neutral-on_inverted);
201
-
202
- background-color: var(--fds-semantic-surface-on_inverted-no_fill-hover);
203
- }
204
- }
205
-
206
- /* Primary button colors */
207
- .fds-button-primary-8fa00f0f:where(.fds-button-first-8fa00f0f) {
208
- background-color: var(--fds-semantic-surface-action-first-default);
209
- }
210
-
211
- .fds-button-primary-8fa00f0f:where(.fds-button-second-8fa00f0f) {
212
- background-color: var(--fds-semantic-surface-action-second-default);
213
- }
214
-
215
- .fds-button-primary-8fa00f0f:where(.fds-button-success-8fa00f0f) {
216
- background-color: var(--fds-semantic-surface-success-default);
217
- }
218
-
219
- .fds-button-primary-8fa00f0f:where(.fds-button-danger-8fa00f0f) {
220
- background-color: var(--fds-semantic-surface-danger-default);
221
- }
222
-
223
- .fds-button-primary-8fa00f0f:where(.fds-button-inverted-8fa00f0f) {
224
- --fc-button-color: var(--fds-semantic-text-neutral-default);
225
-
226
- background-color: var(--fds-semantic-surface-on_inverted-default);
227
- }
228
-
229
- .fds-button-primary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):active {
230
- background-color: var(--fds-semantic-surface-action-first-active);
231
- }
232
-
233
- .fds-button-primary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):active {
234
- background-color: var(--fds-semantic-surface-action-second-active);
235
- }
236
-
237
- .fds-button-primary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):active {
238
- background-color: var(--fds-semantic-surface-success-active);
239
- }
240
-
241
- .fds-button-primary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):active {
242
- background-color: var(--fds-semantic-surface-danger-active);
243
- }
244
-
245
- .fds-button-primary-8fa00f0f:where(.fds-button-inverted-8fa00f0f):not([aria-disabled='true'], :disabled):active {
246
- --fc-button-color: var(--fds-semantic-text-neutral-default);
247
-
248
- background-color: var(--fds-semantic-surface-on_inverted-active);
249
- }
250
-
251
- /* Secondary button colors */
252
- .fds-button-secondary-8fa00f0f:where(.fds-button-first-8fa00f0f) {
253
- --fc-button-color: var(--fds-semantic-text-action-first-default);
254
-
255
- border-color: var(--fds-semantic-border-action-first-default);
256
- background-color: var(--fds-semantic-surface-action-first-no_fill);
257
- }
258
-
259
- .fds-button-secondary-8fa00f0f:where(.fds-button-second-8fa00f0f) {
260
- --fc-button-color: var(--fds-semantic-text-action-second-default);
261
-
262
- border-color: var(--fds-semantic-border-action-second-default);
263
- background-color: var(--fds-semantic-surface-action-second-no_fill);
264
- }
265
-
266
- .fds-button-secondary-8fa00f0f:where(.fds-button-success-8fa00f0f) {
267
- --fc-button-color: var(--fds-semantic-text-success-default);
268
-
269
- border-color: var(--fds-semantic-border-success-default);
270
- background-color: var(--fds-semantic-surface-success-no_fill);
271
- }
272
-
273
- .fds-button-secondary-8fa00f0f:where(.fds-button-danger-8fa00f0f) {
274
- --fc-button-color: var(--fds-semantic-text-danger-default);
275
-
276
- border-color: var(--fds-semantic-border-danger-default);
277
- background-color: var(--fds-semantic-surface-danger-no_fill);
278
- }
279
-
280
- .fds-button-secondary-8fa00f0f:where(.fds-button-inverted-8fa00f0f) {
281
- --fc-button-color: var(--fds-semantic-text-neutral-on_inverted);
282
-
283
- border: 1px solid var(--fds-semantic-border-on_inverted-default);
284
- background-color: transparent;
285
- }
286
-
287
- .fds-button-secondary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):active {
288
- --fc-button-color: var(--fds-semantic-text-action-first-active);
289
-
290
- border-color: var(--fds-semantic-border-action-first-active);
291
- background-color: var(--fds-semantic-surface-action-first-no_fill-active);
292
- }
293
-
294
- .fds-button-secondary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):active {
295
- --fc-button-color: var(--fds-semantic-text-action-second-active);
296
-
297
- border-color: var(--fds-semantic-border-action-second-active);
298
- background-color: var(--fds-semantic-surface-action-second-no_fill-active);
299
- }
300
-
301
- .fds-button-secondary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):active {
302
- --fc-button-color: var(--fds-semantic-text-success-active);
303
-
304
- border-color: var(--fds-semantic-border-success-active);
305
- background-color: var(--fds-semantic-surface-success-no_fill-active);
306
- }
307
-
308
- .fds-button-secondary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):active {
309
- --fc-button-color: var(--fds-semantic-text-danger-active);
310
-
311
- border-color: var(--fds-semantic-border-danger-active);
312
- background-color: var(--fds-semantic-surface-danger-no_fill-active);
313
- }
314
-
315
- .fds-button-secondary-8fa00f0f:where(.fds-button-inverted-8fa00f0f):not([aria-disabled='true'], :disabled):active {
316
- --fc-button-color: var(--fds-semantic-text-neutral-on_inverted);
317
-
318
- background-color: var(--fds-semantic-surface-on_inverted-no_fill-active);
319
- }
320
-
321
- /* Tertiary button colors */
322
- .fds-button-tertiary-8fa00f0f:where(.fds-button-first-8fa00f0f) {
323
- --fc-button-color: var(--fds-semantic-text-action-first-default);
324
- }
325
-
326
- .fds-button-tertiary-8fa00f0f:where(.fds-button-second-8fa00f0f) {
327
- --fc-button-color: var(--fds-semantic-text-action-second-default);
328
- }
329
-
330
- .fds-button-tertiary-8fa00f0f:where(.fds-button-success-8fa00f0f) {
331
- --fc-button-color: var(--fds-semantic-text-success-default);
332
- }
333
-
334
- .fds-button-tertiary-8fa00f0f:where(.fds-button-danger-8fa00f0f) {
335
- --fc-button-color: var(--fds-semantic-text-danger-default);
336
- }
337
-
338
- .fds-button-tertiary-8fa00f0f:where(.fds-button-inverted-8fa00f0f) {
339
- --fc-button-color: var(--fds-semantic-text-neutral-on_inverted);
340
-
341
- background-color: transparent;
342
- }
343
-
344
- .fds-button-tertiary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):active {
345
- --fc-button-color: var(--fds-semantic-text-action-first-active);
346
-
347
- background-color: var(--fds-semantic-surface-action-first-no_fill-active);
348
- }
349
-
350
- .fds-button-tertiary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):active {
351
- --fc-button-color: var(--fds-semantic-text-action-second-active);
352
-
353
- background-color: var(--fds-semantic-surface-action-second-no_fill-active);
354
- }
355
-
356
- .fds-button-tertiary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):active {
357
- --fc-button-color: var(--fds-semantic-text-success-active);
358
-
359
- background-color: var(--fds-semantic-surface-success-no_fill-active);
360
- }
361
-
362
- .fds-button-tertiary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):active {
363
- --fc-button-color: var(--fds-semantic-text-danger-active);
364
-
365
- background-color: var(--fds-semantic-surface-danger-no_fill-active);
366
- }
367
-
368
- .fds-button-tertiary-8fa00f0f:where(.fds-button-inverted-8fa00f0f):not([aria-disabled='true'], :disabled):active {
369
- --fc-button-color: var(--fds-semantic-text-neutral-on_inverted);
370
-
371
- background-color: var(--fds-semantic-surface-on_inverted-no_fill-active);
372
- }
373
- }
374
-
375
1
  @layer fds.paragraph {
376
2
  .fds-paragraph-paragraph-b69df5f3 {
377
3
  --fdsc-bottom-spacing: var(--fds-spacing-5);
@@ -524,26 +150,6 @@
524
150
  }
525
151
  }
526
152
 
527
- @layer fds.ingress {
528
- .fds-ingress-ingress-9b33da65 {
529
- --fdsc-bottom-spacing: var(--fds-spacing-5);
530
-
531
- margin: 0;
532
- color: var(--fds-semantic-text-neutral-default);
533
- }
534
-
535
- .fds-ingress-ingress-9b33da65.fds-ingress-spacing-9b33da65 {
536
- margin-bottom: var(--fdsc-bottom-spacing);
537
- }
538
-
539
- .fds-ingress-ingress-9b33da65.fds-ingress-medium-9b33da65 {
540
- --fdsc-bottom-spacing: var(--fds-spacing-5);
541
-
542
- font: var(--fds-typography-ingress-medium);
543
- font-family: inherit;
544
- }
545
- }
546
-
547
153
  @layer fds.label {
548
154
  .fds-label-label-e0249167 {
549
155
  --fdsc-bottom-spacing: var(--fds-spacing-1);
@@ -1018,7 +624,7 @@
1018
624
  .fds-accordion-first-a8137c3d .fds-accordion-item-a8137c3d:not(:first-child) .fds-accordion-accordionButton-a8137c3d,
1019
625
  .fds-accordion-second-a8137c3d .fds-accordion-item-a8137c3d:not(:first-child) .fds-accordion-accordionButton-a8137c3d,
1020
626
  .fds-accordion-third-a8137c3d .fds-accordion-item-a8137c3d:not(:first-child) .fds-accordion-accordionButton-a8137c3d {
1021
- border-top: 1px solid var(--fds-semantic-border-on_inverted-default);
627
+ border-top: 1px solid var(--fds-semantic-surface-neutral-default);
1022
628
  }
1023
629
 
1024
630
  @media (hover: hover) and (pointer: fine) {
@@ -1460,27 +1066,6 @@
1460
1066
  }
1461
1067
  }
1462
1068
 
1463
- @layer fds.skiplink {
1464
- .fds-skiplink-skiplink-d4abeaef:focus {
1465
- display: block;
1466
- outline: 0;
1467
- position: static;
1468
- width: auto;
1469
- height: auto;
1470
- margin: inherit;
1471
- overflow: visible;
1472
- clip: auto;
1473
- clip-path: none;
1474
- white-space: inherit;
1475
- text-decoration: underline;
1476
- text-decoration-thickness: 3px;
1477
- text-underline-offset: 0.3em;
1478
- padding: var(--fds-spacing-3) var(--fds-spacing-4) var(--fds-spacing-3) var(--fds-spacing-6);
1479
- color: var(--fds-semantic-text-neutral-default);
1480
- background: var(--fds-semantic-border-focus-outline);
1481
- }
1482
- }
1483
-
1484
1069
  @layer fds.tooltip {
1485
1070
  .fds-tooltip-wrapper-a3778147 {
1486
1071
  background: var(--fds-semantic-surface-neutral-inverted);
@@ -2083,7 +1668,7 @@
2083
1668
  }
2084
1669
 
2085
1670
  .fds-switch-input-9a6b03bc:not(:disabled, [readonly]):checked:hover + .fds-switch-label-9a6b03bc .fds-switch-track-9a6b03bc > .fds-switch-thumb-9a6b03bc {
2086
- transform: translateX(calc((var(--fds-switch-width) - var(--fds-switch-height)) * 0.8));
1671
+ transform: translateX(calc((var(--fds-switch-width) - var(--fds-switch-height))));
2087
1672
  background-image: url("data:image/svg+xml,%3Csvg viewBox='-3 -3 17 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M10.1339 2.86612C10.622 3.35427 10.622 4.14573 10.1339 4.63388L5.88388 8.88388C5.39573 9.37204 4.60427 9.37204 4.11612 8.88388L1.86612 6.63388C1.37796 6.14573 1.37796 5.35427 1.86612 4.86612C2.35427 4.37796 3.14573 4.37796 3.63388 4.86612L5 6.23223L8.36612 2.86612C8.85427 2.37796 9.64573 2.37796 10.1339 2.86612Z' fill='%230c6536' /%3E%3C/svg%3E");
2088
1673
  }
2089
1674
 
package/skiplink.css ADDED
@@ -0,0 +1,20 @@
1
+ @layer fds.skiplink {
2
+ .fds-skiplink:focus {
3
+ display: block;
4
+ outline: 0;
5
+ position: static;
6
+ width: auto;
7
+ height: auto;
8
+ margin: inherit;
9
+ overflow: visible;
10
+ clip: auto;
11
+ clip-path: none;
12
+ white-space: inherit;
13
+ text-decoration: underline;
14
+ text-decoration-thickness: 3px;
15
+ text-underline-offset: 0.3em;
16
+ padding: var(--fds-spacing-3) var(--fds-spacing-4) var(--fds-spacing-3) var(--fds-spacing-6);
17
+ color: var(--fds-semantic-text-neutral-default);
18
+ background: var(--fds-semantic-border-focus-outline);
19
+ }
20
+ }
package/utils.css ADDED
@@ -0,0 +1,26 @@
1
+ @layer fds.utils {
2
+ /**
3
+ * Visually hide an element, but leave it available for screen readers
4
+ */
5
+ .fds-sr-only {
6
+ border: 0;
7
+ clip: rect(0 0 0 0);
8
+ height: 1px;
9
+ overflow: hidden;
10
+ padding: 0;
11
+ position: absolute;
12
+ white-space: nowrap;
13
+ width: 1px;
14
+ }
15
+
16
+ /**
17
+ * Apply a focus outline on an element when it is focused with keyboard
18
+ */
19
+ .fds-focus:focus-visible {
20
+ --fds-focus-border-width: 3px;
21
+
22
+ outline: var(--fds-focus-border-width) solid var(--fds-semantic-border-focus-outline);
23
+ outline-offset: var(--fds-focus-border-width);
24
+ box-shadow: 0 0 0 var(--fds-focus-border-width) var(--fds-semantic-border-focus-boxshadow);
25
+ }
26
+ }