@navikt/ds-css 8.5.0 → 8.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navikt/ds-css",
3
- "version": "8.5.0",
3
+ "version": "8.5.2",
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.5.0",
33
+ "@navikt/ds-tokens": "^8.5.2",
34
34
  "browserslist": "^4.25.0",
35
35
  "esbuild": "^0.27.2",
36
36
  "fast-glob": "3.3.3",
@@ -1,23 +1,18 @@
1
+ /* stylelint-disable no-duplicate-selectors */
2
+
1
3
  .aksel-data-table__border-wrapper {
2
- border: 1px solid var(--ax-border-neutral-subtle);
3
- border-radius: var(--ax-radius-12);
4
- overflow: hidden;
5
- flex-grow: 1;
4
+ /* display:flex and max-height:100% is needed for a "no page scroll" layout */
5
+ display: flex;
6
+ max-height: 100%;
6
7
  }
7
8
 
8
9
  .aksel-data-table__scroll-wrapper {
9
10
  overflow: auto;
10
11
  width: 100%;
11
- height: 100%;
12
12
  position: relative;
13
13
  }
14
14
 
15
15
  .aksel-data-table {
16
- border-collapse: collapse;
17
- border-spacing: 0;
18
- table-layout: fixed;
19
- width: 1px; /* This is for some reason needed to make the browser respect the column width. TODO: Test in all browsers */
20
-
21
16
  /*
22
17
  We should NOT set min-width:100% b.c. it will cause inconsistencies in column resizing.
23
18
  We could discuss whether it matters, though. But it feels buggy.
@@ -26,28 +21,37 @@
26
21
  We could have a toggle for the resize feature, and let the consumer decide which downside they prefer. Might need that anyways.
27
22
  */
28
23
 
24
+ &[data-layout="fixed"] {
25
+ table-layout: fixed;
26
+ width: 1px; /* This is for some reason needed to make the browser respect the column width. TODO: Test in all browsers */
27
+ }
28
+
29
+ &[data-layout="auto"] {
30
+ min-width: 100%;
31
+ }
32
+
29
33
  --__axc-data-table-density: var(--ax-space-16) 0;
30
34
 
31
35
  &[data-density="condensed"] {
32
- --__axc-data-table-density: 0 0;
36
+ --__axc-data-table-density: var(--ax-space-8) 0;
33
37
  }
34
38
 
35
39
  &[data-density="spacious"] {
36
40
  --__axc-data-table-density: var(--ax-space-32) 0;
37
41
  }
38
- }
39
42
 
40
- .aksel-data-table--zebra-stripes {
41
- & .aksel-data-table__tbody :where(.aksel-data-table__tr:nth-child(odd)) {
42
- background-color: var(--ax-bg-neutral-softA);
43
+ &[data-zebra-stripes="true"] {
44
+ & .aksel-data-table__tbody :where(.aksel-data-table__tr:nth-child(odd)) {
45
+ background-color: var(--ax-bg-neutral-softA);
46
+ }
43
47
  }
44
- }
45
48
 
46
- .aksel-data-table--truncate-content {
47
- .aksel-data-table__td > div:not(:has(> .aksel-checkbox)) {
48
- text-overflow: ellipsis;
49
- white-space: nowrap;
50
- overflow: hidden;
49
+ &[data-truncate-content="true"] {
50
+ .aksel-data-table__td > div {
51
+ text-overflow: ellipsis;
52
+ white-space: nowrap;
53
+ overflow: hidden;
54
+ }
51
55
  }
52
56
  }
53
57
 
@@ -55,17 +59,12 @@
55
59
  background-color: var(--ax-bg-raised);
56
60
  position: sticky;
57
61
  top: 0;
58
- box-shadow: 0 1px 0 0 var(--ax-border-neutral-subtle);
59
62
  }
60
63
 
61
64
  .aksel-data-table__tbody {
62
65
  background-color: var(--ax-bg-raised);
63
66
  }
64
67
 
65
- .aksel-data-table__tr {
66
- border: none;
67
- }
68
-
69
68
  .aksel-data-table__tr--selected {
70
69
  background-color: var(--ax-bg-softA);
71
70
  box-shadow:
@@ -84,20 +83,51 @@
84
83
  }
85
84
  }
86
85
 
86
+ /* BORDER STYLING START */
87
+
88
+ .aksel-data-table__border-wrapper {
89
+ border-radius: var(--ax-radius-12);
90
+ overflow: hidden;
91
+ position: relative;
92
+
93
+ &::after {
94
+ content: "";
95
+ position: absolute;
96
+ inset: 0;
97
+ pointer-events: none;
98
+ border: 1px solid var(--ax-border-neutral-subtle);
99
+ border-radius: var(--ax-radius-12);
100
+ }
101
+ }
102
+
103
+ .aksel-data-table {
104
+ border-collapse: collapse;
105
+ border-spacing: 0;
106
+ border-right: 1px solid var(--ax-border-neutral-subtle);
107
+ border-bottom: 1px solid var(--ax-border-neutral-subtle);
108
+ }
109
+
110
+ .aksel-data-table__thead {
111
+ box-shadow: 0 1px 0 0 var(--ax-border-neutral-subtle);
112
+ }
113
+
114
+ .aksel-data-table__th,
115
+ .aksel-data-table__td {
116
+ /* border doesn't work on sticky thead when we have collapsed borders, so using box-shadow instead */
117
+ box-shadow: inset 1px 1px 0 0 var(--ax-border-neutral-subtle);
118
+ }
119
+
120
+ /* BORDER STYLING END */
121
+
87
122
  .aksel-data-table__th {
88
123
  position: relative;
89
124
  background-color: var(--ax-bg-neutral-soft);
90
125
  color: var(--ax-text-neutral);
91
126
  padding: var(--ax-space-8) var(--ax-space-16);
92
127
  text-align: start;
93
- border-block-end: 1px solid var(--ax-border-neutral-subtle);
94
-
95
- &:not(:first-child) {
96
- border-inline-start: 1px solid var(--ax-border-neutral-subtle);
97
- }
98
128
  }
99
129
 
100
- .aksel-data-table__th-content:not(:has(> .aksel-checkbox)) {
130
+ .aksel-data-table__th-content {
101
131
  text-overflow: ellipsis;
102
132
  white-space: nowrap;
103
133
  overflow: hidden;
@@ -132,6 +162,15 @@
132
162
  &:active::after {
133
163
  background: var(--ax-bg-strong-pressed);
134
164
  }
165
+
166
+ .aksel-data-table__th:last-child & {
167
+ inset-inline-end: 0;
168
+ width: 15px;
169
+
170
+ &::after {
171
+ inset-inline-end: 0;
172
+ }
173
+ }
135
174
  }
136
175
 
137
176
  .aksel-data-table__th-action-button {
@@ -157,22 +196,11 @@
157
196
  .aksel-data-table__td {
158
197
  text-align: start;
159
198
  vertical-align: middle;
160
- border-block-end: 1px solid var(--ax-border-neutral-subtle);
161
- border-block-start: 1px solid var(--ax-bg-raised);
162
199
  color: var(--ax-text-neutral-subtle);
163
- padding: var(--__axc-data-table-density);
164
- padding-inline: 1rem;
165
-
166
- &:not(:first-child) {
167
- border-inline-start: 1px solid var(--ax-border-neutral-subtle);
168
- }
169
-
170
- .aksel-data-table__tfoot .aksel-data-table__tr:last-child & {
171
- border-block-end: none;
172
- }
173
200
 
174
- .aksel-data-table:not(:has(.aksel-data-table__tfoot)) .aksel-data-table__tr:not(.aksel-data-table__tr--selected):last-child & {
175
- border-block-end: none;
201
+ > div {
202
+ padding: var(--__axc-data-table-density);
203
+ padding-inline: 1rem;
176
204
  }
177
205
  }
178
206
 
package/src/timeline.css CHANGED
@@ -177,7 +177,7 @@
177
177
  .aksel-timeline__pin-wrapper::before {
178
178
  content: "";
179
179
  top: 0.9rem;
180
- height: calc(100% - 0.9rem * 2);
180
+ height: calc(100% - 2rem);
181
181
  width: 1px;
182
182
  margin: 0 auto;
183
183
  background: var(--ax-border-neutral-strong);