@digdir/designsystemet-css 1.0.0-next.34 → 1.0.0-next.35

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/skiplink.css CHANGED
@@ -1,3 +1,7 @@
1
+ .ds-skiplink {
2
+ @composes ds-sr-only from './utilities.css';
3
+ }
4
+
1
5
  .ds-skiplink:focus {
2
6
  display: grid;
3
7
  place-items: center;
@@ -10,19 +14,11 @@
10
14
  clip: auto;
11
15
  clip-path: none;
12
16
  white-space: inherit;
13
- text-decoration: none;
14
17
  padding: var(--ds-spacing-4);
15
- color: var(--ds-color-neutral-text-default);
18
+ color: var(--ds-color-accent-text-default);
16
19
  background: var(--ds-color-accent-surface-hover);
17
- }
18
-
19
- .ds-skiplink__content {
20
- color: var(--dsc-link-color);
20
+ box-sizing: border-box;
21
21
  text-decoration: underline;
22
22
  text-decoration-thickness: max(1px, 0.0625rem);
23
23
  text-underline-offset: max(5px, 0.25rem);
24
- display: inline-flex;
25
- align-items: center;
26
- gap: var(--ds-spacing-1);
27
- margin: 0;
28
24
  }
package/spinner.css CHANGED
@@ -4,10 +4,10 @@
4
4
  --dsc-spinner-size: var(--ds-sizing-11);
5
5
  --dsc-spinner-animation-duration: 2s;
6
6
 
7
- width: var(--dsc-spinner-size);
7
+ animation: ds-spinner-rotate-animation linear infinite var(--dsc-spinner-animation-duration);
8
+ box-sizing: border-box;
8
9
  height: var(--dsc-spinner-size);
9
- animation: ds-spinner-rotate-animation linear infinite;
10
- animation-duration: var(--dsc-spinner-animation-duration);
10
+ width: var(--dsc-spinner-size);
11
11
 
12
12
  &[data-color='accent'] {
13
13
  --dsc-spinner-stroke: var(--ds-color-accent-base-default);
@@ -39,11 +39,10 @@
39
39
  }
40
40
 
41
41
  .ds-spinner__circle {
42
- stroke: var(--dsc-spinner-stroke);
42
+ animation: ds-spinner-stroke-animation ease-in-out infinite var(--dsc-spinner-animation-duration);
43
43
  stroke-dasharray: 1px, 200px;
44
+ stroke: var(--dsc-spinner-stroke);
44
45
  transform-origin: center;
45
- animation: ds-spinner-stroke-animation ease-in-out infinite;
46
- animation-duration: var(--dsc-spinner-animation-duration);
47
46
  }
48
47
 
49
48
  /* Prefers reduced motion needs longer animation,
package/table.css CHANGED
@@ -15,9 +15,12 @@
15
15
  border-collapse: separate; /* Using separate mode to enable border-radius */
16
16
  border-radius: var(--dsc-table-border-radius);
17
17
  border-spacing: 0;
18
+ box-sizing: border-box;
18
19
  color: var(--dsc-table-color);
19
20
  width: 100%;
20
21
 
22
+ @composes ds-body-text--md from './utilities.css';
23
+
21
24
  & > :is(tbody, thead) > tr > :is(th, td) {
22
25
  background: var(--dsc-table-background);
23
26
  border-bottom: var(--dsc-table-border);
@@ -112,10 +115,14 @@
112
115
  */
113
116
  &[data-size='sm'] {
114
117
  --dsc-table-padding: var(--ds-spacing-1) var(--ds-spacing-3);
118
+
119
+ @composes ds-body-text--sm from './utilities.css';
115
120
  }
116
121
 
117
122
  &[data-size='lg'] {
118
123
  --dsc-table-padding: var(--ds-spacing-3) var(--ds-spacing-3);
124
+
125
+ @composes ds-body-text--lg from './utilities.css';
119
126
  }
120
127
 
121
128
  /**
package/tabs.css CHANGED
@@ -6,14 +6,20 @@
6
6
  --dsc-tabs-content-color: var(--ds-color-neutral-text-default);
7
7
  --dsc-tabs-list-border-color: var(--ds-color-neutral-border-subtle);
8
8
 
9
+ @composes ds-body-text--short-md from './utilities.css';
10
+
9
11
  &[data-size='sm'] {
10
12
  --dsc-tabs-tab-padding: var(--ds-spacing-2) var(--ds-spacing-4);
11
13
  --dsc-tabs-content-padding: var(--ds-spacing-4);
14
+
15
+ @composes ds-body-text--short-sm from './utilities.css';
12
16
  }
13
17
 
14
18
  &[data-size='lg'] {
15
19
  --dsc-tabs-tab-padding: var(--ds-spacing-4) var(--ds-spacing-6);
16
20
  --dsc-tabs-content-padding: var(--ds-spacing-6);
21
+
22
+ @composes ds-body-text--short-lg from './utilities.css';
17
23
  }
18
24
  }
19
25
 
@@ -30,21 +36,18 @@
30
36
  }
31
37
 
32
38
  .ds-tabs__tab {
39
+ all: unset; /* Reset <button> */
40
+ align-items: center;
41
+ box-sizing: border-box;
42
+ color: var(--dsc-tabs-tab-color);
43
+ cursor: pointer;
33
44
  display: flex;
34
45
  flex-direction: row;
35
- box-sizing: border-box;
36
46
  gap: var(--ds-spacing-1);
37
47
  justify-content: center;
38
- text-align: center;
39
- align-items: center;
40
48
  padding: var(--dsc-tabs-tab-padding);
41
- border: none;
42
- border-radius: 0;
43
- background-color: transparent;
44
- cursor: pointer;
45
- color: var(--dsc-tabs-tab-color);
46
49
  position: relative;
47
- font-family: inherit;
50
+ text-align: center;
48
51
 
49
52
  &[aria-selected='true'] {
50
53
  --dsc-tabs__tab-bottom-border-color: var(--ds-color-accent-base-default);
package/tag.css CHANGED
@@ -15,14 +15,20 @@
15
15
  width: max-content;
16
16
  word-break: break-word;
17
17
 
18
+ @composes ds-body-text--short-md from './utilities.css';
19
+
18
20
  &[data-size='sm'] {
19
21
  --dsc-tag-padding: 0 var(--ds-spacing-2);
20
22
  --dsc-tag-min-height: var(--ds-sizing-7);
23
+
24
+ @composes ds-body-text--short-sm from './utilities.css';
21
25
  }
22
26
 
23
27
  &[data-size='lg'] {
24
28
  --dsc-tag-padding: 0 var(--ds-spacing-3);
25
29
  --dsc-tag-min-height: var(--ds-sizing-9);
30
+
31
+ @composes ds-body-text--short-lg from './utilities.css';
26
32
  }
27
33
 
28
34
  &[data-color='info'] {
package/tooltip.css CHANGED
@@ -2,9 +2,12 @@
2
2
  --dsc-tooltip-background: var(--ds-color-neutral-text-default);
3
3
 
4
4
  background: var(--dsc-tooltip-background);
5
- padding: var(--ds-spacing-1) var(--ds-spacing-2);
6
- color: var(--ds-color-neutral-background-default);
7
5
  border-radius: var(--ds-border-radius-md);
6
+ box-sizing: border-box;
7
+ color: var(--ds-color-neutral-background-default);
8
+ padding: var(--ds-spacing-1) var(--ds-spacing-2);
9
+
10
+ @composes ds-body-text--short-xs from './utilities.css';
8
11
  }
9
12
 
10
13
  .ds-tooltip__arrow {
package/utilities.css CHANGED
@@ -12,30 +12,186 @@
12
12
  width: 1px;
13
13
  }
14
14
 
15
- :root {
15
+ :root,
16
+ [data-ds-color-mode] {
16
17
  --dsc-focus-border-width: 3px; /* Default focus border width */
17
- --dsc-focus-boxShadow: 0 0 0 var(--dsc-focus-border-width) var(--ds-color-focus-inner),
18
- 0 0 0 calc(var(--dsc-focus-border-width) * 2) var(--ds-color-focus-outer);
18
+ --dsc-focus-boxShadow: 0 0 0 var(--dsc-focus-border-width) var(--ds-color-focus-inner);
19
+ --dsc-focus-outline: var(--ds-color-focus-outer) solid var(--dsc-focus-border-width);
19
20
  }
20
21
 
21
22
  /**
22
23
  * Apply a focus outline on an element when it is focused with keyboard
23
24
  */
24
- .ds-focus:focus-visible {
25
- outline: none;
25
+ .ds-focus:focus-visible {
26
+ @composes ds-focus--visible from './utilities.css';
27
+ }
28
+
29
+ /**
30
+ * Focus outline that can be composed if it needs a specific selector
31
+ */
32
+ .ds-focus--visible {
33
+ /**
34
+ * We use both box-shadow and outline to ensure that the focus style is visible,
35
+ * in case box-shadow is overridden.
36
+ */
26
37
  box-shadow: var(--dsc-focus-boxShadow);
38
+ outline: var(--dsc-focus-outline);
39
+ outline-offset: var(--dsc-focus-border-width);
27
40
  }
28
41
 
29
- .ds-animate-height--openingOrClosing,
30
- .ds-animate-height--closed {
31
- overflow: hidden;
42
+ /** Body typography */
43
+ .ds-body-text--xs {
44
+ font-weight: var(--ds-body-xs-font-weight);
45
+ line-height: var(--ds-body-xs-line-height);
46
+ font-size: var(--ds-body-xs-font-size);
47
+ letter-spacing: var(--ds-body-xs-letter-spacing);
48
+ }
49
+
50
+ .ds-body-text--sm {
51
+ font-weight: var(--ds-body-sm-font-weight);
52
+ line-height: var(--ds-body-sm-line-height);
53
+ font-size: var(--ds-body-sm-font-size);
54
+ letter-spacing: var(--ds-body-sm-letter-spacing);
55
+ }
56
+
57
+ .ds-body-text--md {
58
+ font-weight: var(--ds-body-md-font-weight);
59
+ line-height: var(--ds-body-md-line-height);
60
+ font-size: var(--ds-body-md-font-size);
61
+ letter-spacing: var(--ds-body-md-letter-spacing);
62
+ }
63
+
64
+ .ds-body-text--lg {
65
+ font-weight: var(--ds-body-lg-font-weight);
66
+ line-height: var(--ds-body-lg-line-height);
67
+ font-size: var(--ds-body-lg-font-size);
68
+ letter-spacing: var(--ds-body-lg-letter-spacing);
69
+ }
70
+
71
+ .ds-body-text--xl {
72
+ font-weight: var(--ds-body-xl-font-weight);
73
+ line-height: var(--ds-body-xl-line-height);
74
+ font-size: var(--ds-body-xl-font-size);
75
+ letter-spacing: var(--ds-body-xl-letter-spacing);
76
+ }
77
+
78
+ .ds-body-text--long-xs {
79
+ font-weight: var(--ds-body-long-xs-font-weight);
80
+ line-height: var(--ds-body-long-xs-line-height);
81
+ font-size: var(--ds-body-long-xs-font-size);
82
+ letter-spacing: var(--ds-body-long-xs-letter-spacing);
83
+ }
84
+
85
+ .ds-body-text--long-sm {
86
+ font-weight: var(--ds-body-long-sm-font-weight);
87
+ line-height: var(--ds-body-long-sm-line-height);
88
+ font-size: var(--ds-body-long-sm-font-size);
89
+ letter-spacing: var(--ds-body-long-sm-letter-spacing);
90
+ }
91
+
92
+ .ds-body-text--long-md {
93
+ font-weight: var(--ds-body-long-md-font-weight);
94
+ line-height: var(--ds-body-long-md-line-height);
95
+ font-size: var(--ds-body-long-md-font-size);
96
+ letter-spacing: var(--ds-body-long-md-letter-spacing);
97
+ }
98
+
99
+ .ds-body-text--long-lg {
100
+ font-weight: var(--ds-body-long-lg-font-weight);
101
+ line-height: var(--ds-body-long-lg-line-height);
102
+ font-size: var(--ds-body-long-lg-font-size);
103
+ letter-spacing: var(--ds-body-long-lg-letter-spacing);
104
+ }
105
+
106
+ .ds-body-text--long-xl {
107
+ font-weight: var(--ds-body-long-xl-font-weight);
108
+ line-height: var(--ds-body-long-xl-line-height);
109
+ font-size: var(--ds-body-long-xl-font-size);
110
+ letter-spacing: var(--ds-body-long-xl-letter-spacing);
111
+ }
112
+
113
+ .ds-body-text--short-xs {
114
+ font-weight: var(--ds-body-short-xs-font-weight);
115
+ line-height: var(--ds-body-short-xs-line-height);
116
+ font-size: var(--ds-body-short-xs-font-size);
117
+ letter-spacing: var(--ds-body-short-xs-letter-spacing);
118
+ }
119
+
120
+ .ds-body-text--short-sm {
121
+ font-weight: var(--ds-body-short-sm-font-weight);
122
+ line-height: var(--ds-body-short-sm-line-height);
123
+ font-size: var(--ds-body-short-sm-font-size);
124
+ letter-spacing: var(--ds-body-short-sm-letter-spacing);
125
+ }
126
+
127
+ .ds-body-text--short-md {
128
+ font-weight: var(--ds-body-short-md-font-weight);
129
+ line-height: var(--ds-body-short-md-line-height);
130
+ font-size: var(--ds-body-short-md-font-size);
131
+ letter-spacing: var(--ds-body-short-md-letter-spacing);
132
+ }
133
+
134
+ .ds-body-text--short-lg {
135
+ font-weight: var(--ds-body-short-lg-font-weight);
136
+ line-height: var(--ds-body-short-lg-line-height);
137
+ font-size: var(--ds-body-short-lg-font-size);
138
+ letter-spacing: var(--ds-body-short-lg-letter-spacing);
139
+ }
140
+
141
+ .ds-body-text--short-xl {
142
+ font-weight: var(--ds-body-short-xl-font-weight);
143
+ line-height: var(--ds-body-short-xl-line-height);
144
+ font-size: var(--ds-body-short-xl-font-size);
145
+ letter-spacing: var(--ds-body-short-xl-letter-spacing);
146
+ }
147
+
148
+ /** Heading */
149
+
150
+ .ds-heading-text--2xs {
151
+ font-weight: var(--ds-heading-2xs-font-weight);
152
+ line-height: var(--ds-heading-2xs-line-height);
153
+ font-size: var(--ds-heading-2xs-font-size);
154
+ letter-spacing: var(--ds-heading-2xs-letter-spacing);
155
+ }
156
+
157
+ .ds-heading-text--xs {
158
+ font-weight: var(--ds-heading-xs-font-weight);
159
+ line-height: var(--ds-heading-xs-line-height);
160
+ font-size: var(--ds-heading-xs-font-size);
161
+ letter-spacing: var(--ds-heading-xs-letter-spacing);
162
+ }
163
+
164
+ .ds-heading-text--sm {
165
+ font-weight: var(--ds-heading-sm-font-weight);
166
+ line-height: var(--ds-heading-sm-line-height);
167
+ font-size: var(--ds-heading-sm-font-size);
168
+ letter-spacing: var(--ds-heading-sm-letter-spacing);
169
+ }
170
+
171
+ .ds-heading-text--md {
172
+ font-size: var(--ds-heading-md-font-size);
173
+ font-weight: var(--ds-heading-md-font-weight);
174
+ letter-spacing: var(--ds-heading-md-letter-spacing);
175
+ line-height: var(--ds-heading-md-line-height);
176
+ }
177
+
178
+ .ds-heading-text--lg {
179
+ font-weight: var(--ds-heading-lg-font-weight);
180
+ line-height: var(--ds-heading-lg-line-height);
181
+ font-size: var(--ds-heading-lg-font-size);
182
+ letter-spacing: var(--ds-heading-lg-letter-spacing);
32
183
  }
33
184
 
34
- .ds-animate-height--open .ds-animate-height__content {
35
- height: auto;
185
+ .ds-heading-text--xl {
186
+ font-weight: var(--ds-heading-xl-font-weight);
187
+ line-height: var(--ds-heading-xl-line-height);
188
+ font-size: var(--ds-heading-xl-font-size);
189
+ letter-spacing: var(--ds-heading-xl-letter-spacing);
36
190
  }
37
191
 
38
- .ds-animate-height--closed .ds-animate-height__content {
39
- height: 0;
40
- display: none;
192
+ .ds-heading-text--2xl {
193
+ font-weight: var(--ds-heading-2xl-font-weight);
194
+ line-height: var(--ds-heading-2xl-line-height);
195
+ font-size: var(--ds-heading-2xl-font-size);
196
+ letter-spacing: var(--ds-heading-2xl-letter-spacing);
41
197
  }