@navikt/ds-css 2.8.16 → 2.9.1

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.
Files changed (87) hide show
  1. package/.gitignore +1 -0
  2. package/CHANGELOG.md +12 -0
  3. package/baseline/_inline-reset.css +52 -0
  4. package/baseline/{utility.css → _utilities.css} +21 -8
  5. package/baseline/baseline.css +2 -35
  6. package/baseline/index.css +5 -0
  7. package/baseline/reset.css +294 -0
  8. package/baseline/tokens.css +1 -0
  9. package/config/_mappings.d.ts +24 -0
  10. package/config/_mappings.js +149 -0
  11. package/config/get-version.js +4 -0
  12. package/dist/component/accordion.css +74 -0
  13. package/dist/component/accordion.min.css +1 -0
  14. package/dist/component/alert.css +76 -0
  15. package/dist/component/alert.min.css +1 -0
  16. package/dist/component/button.css +352 -0
  17. package/dist/component/button.min.css +1 -0
  18. package/dist/component/chat.css +98 -0
  19. package/dist/component/chat.min.css +1 -0
  20. package/dist/component/chips.css +138 -0
  21. package/dist/component/chips.min.css +1 -0
  22. package/dist/component/contentcontainer.css +17 -0
  23. package/dist/component/contentcontainer.min.css +1 -0
  24. package/dist/component/date.css +221 -0
  25. package/dist/component/date.min.css +1 -0
  26. package/dist/component/expansioncard.css +197 -0
  27. package/dist/component/expansioncard.min.css +3 -0
  28. package/dist/component/form.css +734 -0
  29. package/dist/component/form.min.css +1 -0
  30. package/dist/component/grid.css +217 -0
  31. package/dist/component/grid.min.css +1 -0
  32. package/dist/component/guidepanel.css +62 -0
  33. package/dist/component/guidepanel.min.css +1 -0
  34. package/dist/component/helptext.css +45 -0
  35. package/dist/component/helptext.min.css +1 -0
  36. package/dist/component/index.css +3988 -0
  37. package/dist/component/index.min.css +4 -0
  38. package/dist/component/link.css +37 -0
  39. package/dist/component/link.min.css +1 -0
  40. package/dist/component/linkpanel.css +38 -0
  41. package/dist/component/linkpanel.min.css +1 -0
  42. package/dist/component/list.css +66 -0
  43. package/dist/component/list.min.css +1 -0
  44. package/dist/component/loader.css +113 -0
  45. package/dist/component/loader.min.css +1 -0
  46. package/dist/component/modal.css +61 -0
  47. package/dist/component/modal.min.css +1 -0
  48. package/dist/component/pagination.css +60 -0
  49. package/dist/component/pagination.min.css +1 -0
  50. package/dist/component/panel.css +10 -0
  51. package/dist/component/panel.min.css +1 -0
  52. package/dist/component/popover.css +54 -0
  53. package/dist/component/popover.min.css +1 -0
  54. package/dist/component/readmore.css +63 -0
  55. package/dist/component/readmore.min.css +1 -0
  56. package/dist/component/stepper.css +225 -0
  57. package/dist/component/stepper.min.css +1 -0
  58. package/dist/component/table.css +227 -0
  59. package/dist/component/table.min.css +1 -0
  60. package/dist/component/tabs.css +114 -0
  61. package/dist/component/tabs.min.css +1 -0
  62. package/dist/component/tag.css +116 -0
  63. package/dist/component/tag.min.css +1 -0
  64. package/dist/component/togglegroup.css +100 -0
  65. package/dist/component/togglegroup.min.css +1 -0
  66. package/dist/component/tooltip.css +53 -0
  67. package/dist/component/tooltip.min.css +1 -0
  68. package/dist/component/typography.css +160 -0
  69. package/dist/component/typography.min.css +1 -0
  70. package/dist/components.css +3272 -0
  71. package/dist/components.min.css +3 -0
  72. package/dist/global/baseline.css +138 -0
  73. package/dist/global/baseline.min.css +1 -0
  74. package/dist/global/fonts.css +21 -0
  75. package/dist/global/fonts.min.css +1 -0
  76. package/dist/global/print.css +75 -0
  77. package/dist/global/print.min.css +1 -0
  78. package/dist/global/reset.css +294 -0
  79. package/dist/global/reset.min.css +1 -0
  80. package/dist/global/tokens.css +279 -0
  81. package/dist/global/tokens.min.css +1 -0
  82. package/dist/index.css +73 -85
  83. package/dist/index.min.css +4 -0
  84. package/form/fieldset.css +4 -0
  85. package/index.css +1 -1
  86. package/package.json +21 -5
  87. package/typography.css +5 -4
package/.gitignore ADDED
@@ -0,0 +1 @@
1
+ !*.d.ts
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @navikt/ds-css
2
2
 
3
+ ## 2.9.1
4
+
5
+ ## 2.9.0
6
+
7
+ ### Minor Changes
8
+
9
+ - [#1941](https://github.com/navikt/aksel/pull/1941) [`657b7f3f3`](https://github.com/navikt/aksel/commit/657b7f3f3e62c5ce3173e6c95a29fcd237ce7343) Thanks [@KenAJoh](https://github.com/KenAJoh)! - :tada: CSS nå tilgjengelig som separate filer
10
+
11
+ - Kan lastest fra CDN
12
+ - Tilbys nå i minified-versjoner
13
+ - Kommandoline: `npx @navikt/aksel css-imports` for å raskt komme i gang med CSS-optimalisering
14
+
3
15
  ## 2.8.16
4
16
 
5
17
  ## 2.8.15
@@ -0,0 +1,52 @@
1
+ html,
2
+ :host {
3
+ box-sizing: border-box;
4
+ }
5
+
6
+ *,
7
+ *::before,
8
+ *::after {
9
+ box-sizing: inherit;
10
+ }
11
+
12
+ button,
13
+ input,
14
+ optgroup,
15
+ select,
16
+ textarea {
17
+ font-family: inherit;
18
+ font-size: 100%;
19
+ line-height: 1.15;
20
+ margin: 0;
21
+ color: inherit;
22
+ }
23
+
24
+ button,
25
+ input {
26
+ overflow: visible;
27
+ }
28
+
29
+ button,
30
+ select {
31
+ text-transform: none;
32
+ }
33
+
34
+ button,
35
+ [type="button"],
36
+ [type="reset"],
37
+ [type="submit"] {
38
+ -webkit-appearance: button;
39
+ }
40
+
41
+ legend {
42
+ box-sizing: border-box;
43
+ color: inherit;
44
+ display: table;
45
+ max-width: 100%;
46
+ padding: 0;
47
+ white-space: normal;
48
+ }
49
+
50
+ [hidden] {
51
+ display: none;
52
+ }
@@ -1,3 +1,18 @@
1
+ /* https://web.dev/prefers-reduced-motion/ */
2
+ @media (prefers-reduced-motion: reduce) {
3
+ *:not(.navds-loader *):not(.navds-loader),
4
+ ::before,
5
+ ::after {
6
+ animation-delay: -1ms !important;
7
+ animation-duration: 1ms !important;
8
+ animation-iteration-count: 1 !important;
9
+ background-attachment: initial !important;
10
+ scroll-behavior: auto !important;
11
+ transition-duration: 0s !important;
12
+ transition-delay: 0s !important;
13
+ }
14
+ }
15
+
1
16
  /*
2
17
  * From https://github.com/h5bp/html5-boilerplate/blob/master/dist/css/style.css
3
18
  *
@@ -20,17 +35,15 @@
20
35
  position: absolute;
21
36
  white-space: nowrap;
22
37
  width: 1px;
23
-
24
- /* 1 */
25
38
  }
26
39
 
27
40
  /*
28
- * From https://github.com/h5bp/html5-boilerplate/blob/master/dist/css/style.css
29
- *
30
- * Extends the .sr-only class to allow the element
31
- * to be focusable when navigated to via the keyboard:
32
- * https://www.drupal.org/node/897638
33
- */
41
+ * From https://github.com/h5bp/html5-boilerplate/blob/master/dist/css/style.css
42
+ *
43
+ * Extends the .sr-only class to allow the element
44
+ * to be focusable when navigated to via the keyboard:
45
+ * https://www.drupal.org/node/897638
46
+ */
34
47
 
35
48
  .sr-only.focusable:active,
36
49
  .sr-only.focusable:focus,
@@ -1,19 +1,5 @@
1
- @import "@navikt/ds-tokens";
2
- @import "normalize.css";
3
- @import "fonts.css";
4
- @import "print.css";
5
- @import "utility.css";
6
-
7
- html,
8
- :host {
9
- box-sizing: border-box;
10
- }
11
-
12
- *,
13
- *::before,
14
- *::after {
15
- box-sizing: inherit;
16
- }
1
+ @import "./_inline-reset.css";
2
+ @import "./_utilities.css";
17
3
 
18
4
  :root,
19
5
  :host,
@@ -39,22 +25,3 @@ body,
39
25
  a {
40
26
  color: var(--a-text-action);
41
27
  }
42
-
43
- button {
44
- color: inherit;
45
- }
46
-
47
- /* https://web.dev/prefers-reduced-motion/ */
48
- @media (prefers-reduced-motion: reduce) {
49
- *:not(.navds-loader *):not(.navds-loader),
50
- ::before,
51
- ::after {
52
- animation-delay: -1ms !important;
53
- animation-duration: 1ms !important;
54
- animation-iteration-count: 1 !important;
55
- background-attachment: initial !important;
56
- scroll-behavior: auto !important;
57
- transition-duration: 0s !important;
58
- transition-delay: 0s !important;
59
- }
60
- }
@@ -0,0 +1,5 @@
1
+ @import "@navikt/ds-tokens";
2
+ @import "reset.css";
3
+ @import "fonts.css";
4
+ @import "print.css";
5
+ @import "baseline.css";
@@ -0,0 +1,294 @@
1
+ /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
2
+
3
+ /* Document
4
+ ========================================================================== */
5
+
6
+ /**
7
+ * 1. Correct the line height in all browsers.
8
+ * 2. Prevent adjustments of font size after orientation changes in iOS.
9
+ */
10
+
11
+ html {
12
+ line-height: 1.15; /* 1 */
13
+ -webkit-text-size-adjust: 100%; /* 2 */
14
+ }
15
+
16
+ /* Sections
17
+ ========================================================================== */
18
+
19
+ /**
20
+ * Remove the margin in all browsers.
21
+ */
22
+
23
+ body {
24
+ margin: 0;
25
+ }
26
+
27
+ /**
28
+ * Render the `main` element consistently in IE.
29
+ */
30
+
31
+ main {
32
+ display: block;
33
+ }
34
+
35
+ /**
36
+ * Correct the font size and margin on `h1` elements within `section` and
37
+ * `article` contexts in Chrome, Firefox, and Safari.
38
+ */
39
+
40
+ h1 {
41
+ font-size: 2em;
42
+ margin: 0.67em 0;
43
+ }
44
+
45
+ /* Grouping content
46
+ ========================================================================== */
47
+
48
+ /**
49
+ * 1. Add the correct box sizing in Firefox.
50
+ * 2. Show the overflow in Edge and IE.
51
+ */
52
+
53
+ hr {
54
+ box-sizing: content-box; /* 1 */
55
+ height: 0; /* 1 */
56
+ overflow: visible; /* 2 */
57
+ }
58
+
59
+ /**
60
+ * 1. Correct the inheritance and scaling of font size in all browsers.
61
+ * 2. Correct the odd `em` font sizing in all browsers.
62
+ */
63
+
64
+ pre {
65
+ font-family: monospace; /* 1 */
66
+ font-size: 1em; /* 2 */
67
+ }
68
+
69
+ /* Text-level semantics
70
+ ========================================================================== */
71
+
72
+ /**
73
+ * Remove the gray background on active links in IE 10.
74
+ */
75
+
76
+ a {
77
+ background-color: transparent;
78
+ }
79
+
80
+ /**
81
+ * 1. Remove the bottom border in Chrome 57-
82
+ * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
83
+ */
84
+
85
+ abbr[title] {
86
+ border-bottom: none; /* 1 */
87
+ text-decoration: underline; /* 2 */
88
+ text-decoration: underline dotted; /* 2 */
89
+ }
90
+
91
+ /**
92
+ * Add the correct font weight in Chrome, Edge, and Safari.
93
+ */
94
+
95
+ b,
96
+ strong {
97
+ font-weight: bolder;
98
+ }
99
+
100
+ /**
101
+ * 1. Correct the inheritance and scaling of font size in all browsers.
102
+ * 2. Correct the odd `em` font sizing in all browsers.
103
+ */
104
+
105
+ code,
106
+ kbd,
107
+ samp {
108
+ font-family: monospace; /* 1 */
109
+ font-size: 1em; /* 2 */
110
+ }
111
+
112
+ /**
113
+ * Add the correct font size in all browsers.
114
+ */
115
+
116
+ small {
117
+ font-size: 80%;
118
+ }
119
+
120
+ /**
121
+ * Prevent `sub` and `sup` elements from affecting the line height in
122
+ * all browsers.
123
+ */
124
+
125
+ sub,
126
+ sup {
127
+ font-size: 75%;
128
+ line-height: 0;
129
+ position: relative;
130
+ vertical-align: baseline;
131
+ }
132
+
133
+ sub {
134
+ bottom: -0.25em;
135
+ }
136
+
137
+ sup {
138
+ top: -0.5em;
139
+ }
140
+
141
+ /* Embedded content
142
+ ========================================================================== */
143
+
144
+ /**
145
+ * Remove the border on images inside links in IE 10.
146
+ */
147
+
148
+ img {
149
+ border-style: none;
150
+ }
151
+
152
+ /* Forms
153
+ ========================================================================== */
154
+
155
+ /**
156
+ * Remove the inner border and padding in Firefox.
157
+ */
158
+
159
+ button::-moz-focus-inner,
160
+ [type="button"]::-moz-focus-inner,
161
+ [type="reset"]::-moz-focus-inner,
162
+ [type="submit"]::-moz-focus-inner {
163
+ border-style: none;
164
+ padding: 0;
165
+ }
166
+
167
+ /**
168
+ * Restore the focus styles unset by the previous rule.
169
+ */
170
+
171
+ button:-moz-focusring,
172
+ [type="button"]:-moz-focusring,
173
+ [type="reset"]:-moz-focusring,
174
+ [type="submit"]:-moz-focusring {
175
+ outline: 1px dotted ButtonText;
176
+ }
177
+
178
+ /**
179
+ * Correct the padding in Firefox.
180
+ */
181
+
182
+ fieldset {
183
+ padding: 0.35em 0.75em 0.625em;
184
+ }
185
+
186
+ /**
187
+ * 1. Correct the text wrapping in Edge and IE.
188
+ * 2. Correct the color inheritance from `fieldset` elements in IE.
189
+ * 3. Remove the padding so developers are not caught out when they zero out
190
+ * `fieldset` elements in all browsers.
191
+ */
192
+
193
+ legend {
194
+ box-sizing: border-box; /* 1 */
195
+ color: inherit; /* 2 */
196
+ display: table; /* 1 */
197
+ max-width: 100%; /* 1 */
198
+ padding: 0; /* 3 */
199
+ white-space: normal; /* 1 */
200
+ }
201
+
202
+ /**
203
+ * Add the correct vertical alignment in Chrome, Firefox, and Opera.
204
+ */
205
+
206
+ progress {
207
+ vertical-align: baseline;
208
+ }
209
+
210
+ /**
211
+ * Remove the default vertical scrollbar in IE 10+.
212
+ */
213
+
214
+ textarea {
215
+ overflow: auto;
216
+ }
217
+
218
+ /**
219
+ * 1. Add the correct box sizing in IE 10.
220
+ * 2. Remove the padding in IE 10.
221
+ */
222
+
223
+ [type="checkbox"],
224
+ [type="radio"] {
225
+ box-sizing: border-box; /* 1 */
226
+ padding: 0; /* 2 */
227
+ }
228
+
229
+ /**
230
+ * Correct the cursor style of increment and decrement buttons in Chrome.
231
+ */
232
+
233
+ [type="number"]::-webkit-inner-spin-button,
234
+ [type="number"]::-webkit-outer-spin-button {
235
+ height: auto;
236
+ }
237
+
238
+ /**
239
+ * 1. Correct the odd appearance in Chrome and Safari.
240
+ * 2. Correct the outline style in Safari.
241
+ */
242
+
243
+ [type="search"] {
244
+ -webkit-appearance: textfield; /* 1 */
245
+ outline-offset: -2px; /* 2 */
246
+ }
247
+
248
+ /**
249
+ * Remove the inner padding in Chrome and Safari on macOS.
250
+ */
251
+
252
+ [type="search"]::-webkit-search-decoration {
253
+ -webkit-appearance: none;
254
+ }
255
+
256
+ /**
257
+ * 1. Correct the inability to style clickable types in iOS and Safari.
258
+ * 2. Change font properties to `inherit` in Safari.
259
+ */
260
+
261
+ ::-webkit-file-upload-button {
262
+ -webkit-appearance: button; /* 1 */
263
+ font: inherit; /* 2 */
264
+ }
265
+
266
+ /* Interactive
267
+ ========================================================================== */
268
+
269
+ /*
270
+ * Add the correct display in Edge, IE 10+, and Firefox.
271
+ */
272
+
273
+ details {
274
+ display: block;
275
+ }
276
+
277
+ /*
278
+ * Add the correct display in all browsers.
279
+ */
280
+
281
+ summary {
282
+ display: list-item;
283
+ }
284
+
285
+ /* Misc
286
+ ========================================================================== */
287
+
288
+ /**
289
+ * Add the correct display in IE 10+.
290
+ */
291
+
292
+ template {
293
+ display: none;
294
+ }
@@ -0,0 +1 @@
1
+ @import "@navikt/ds-tokens";
@@ -0,0 +1,24 @@
1
+ export declare const rootDir = "dist";
2
+ export declare const globalDir = "dist/global";
3
+ export declare const componentDir = "dist/component";
4
+ export declare const typoCss = "typography.css";
5
+ export declare const formCss = "form.css";
6
+ export declare const componentsCss = "components.css";
7
+ export declare const StyleMappings: {
8
+ baseline: {
9
+ main: string;
10
+ optional: boolean;
11
+ }[];
12
+ components: (
13
+ | {
14
+ component: string;
15
+ main: string;
16
+ dependencies: string[];
17
+ }
18
+ | {
19
+ component: string;
20
+ main: string;
21
+ dependencies?: undefined;
22
+ }
23
+ )[];
24
+ };
@@ -0,0 +1,149 @@
1
+ const rootDir = "dist";
2
+ const globalDir = "dist/global";
3
+ const componentDir = "dist/component";
4
+
5
+ const typoCss = "typography.css";
6
+ const formCss = "form.css";
7
+ const componentsCss = "components.css";
8
+
9
+ const StyleMappings = {
10
+ baseline: [
11
+ {
12
+ main: "fonts.css",
13
+ optional: false,
14
+ },
15
+ {
16
+ main: "tokens.css",
17
+ optional: false,
18
+ },
19
+ {
20
+ main: "reset.css",
21
+ optional: true,
22
+ },
23
+ {
24
+ main: "baseline.css",
25
+ optional: false,
26
+ },
27
+ {
28
+ main: "print.css",
29
+ optional: true,
30
+ },
31
+ ],
32
+ components: [
33
+ {
34
+ component: "Accordion",
35
+ main: "accordion.css",
36
+ dependencies: [typoCss],
37
+ },
38
+ { component: "Alert", main: "alert.css", dependencies: [typoCss] },
39
+ {
40
+ component: "BodyLong",
41
+ main: typoCss,
42
+ },
43
+ {
44
+ component: "BodyShort",
45
+ main: typoCss,
46
+ },
47
+ {
48
+ component: "Button",
49
+ main: "button.css",
50
+ dependencies: [typoCss, "loader.css"],
51
+ },
52
+ { component: "Cell", main: "grid.css" },
53
+ { component: "Chat", main: "chat.css", dependencies: [typoCss] },
54
+ { component: "Checkbox", main: formCss, dependencies: [typoCss] },
55
+ { component: "CheckboxGroup", main: formCss, dependencies: [typoCss] },
56
+ { component: "Chips", main: "chips.css", dependencies: [typoCss] },
57
+ {
58
+ component: "ConfirmationPanel",
59
+ main: formCss,
60
+ dependencies: [typoCss],
61
+ },
62
+ {
63
+ component: "ContentContainer",
64
+ main: "content-container.css",
65
+ },
66
+ { component: "Detail", main: typoCss },
67
+ { component: "ErrorMessage", main: typoCss },
68
+ { component: "ErrorSummary", main: formCss, dependencies: [typoCss] },
69
+ {
70
+ component: "ExpansionCard",
71
+ main: "expansion-card.css",
72
+ dependencies: [typoCss],
73
+ },
74
+ { component: "Fieldset", main: formCss, dependencies: [typoCss] },
75
+ { component: "Grid", main: "grid.css", dependencies: [typoCss] },
76
+ {
77
+ component: "GuidePanel",
78
+ main: "guide-panel.css",
79
+ dependencies: [typoCss],
80
+ },
81
+ { component: "Heading", main: typoCss, dependencies: [typoCss] },
82
+ {
83
+ component: "HelpText",
84
+ main: "help-text.css",
85
+ dependencies: ["popover.css"],
86
+ },
87
+ { component: "Ingress", main: typoCss },
88
+ { component: "Label", main: typoCss },
89
+ { component: "Link", main: "link.css", dependencies: [typoCss] },
90
+ {
91
+ component: "LinkPanel",
92
+ main: "link-panel.css",
93
+ dependencies: [typoCss, "panel.css"],
94
+ },
95
+ { component: "List", main: "list.css", dependencies: [typoCss] },
96
+ { component: "Loader", main: "loader.css" },
97
+ {
98
+ component: "Modal",
99
+ main: "modal.css",
100
+ dependencies: ["button.css"],
101
+ },
102
+ {
103
+ component: "Pagination",
104
+ main: "pagination.css",
105
+ dependencies: [typoCss, "button.css"],
106
+ },
107
+ { component: "Panel", main: "panel.css" },
108
+ { component: "Popover", main: "popover.css" },
109
+ { component: "Provider", main: "" },
110
+ { component: "Radio", main: formCss, dependencies: [typoCss] },
111
+ { component: "RadioGroup", main: formCss, dependencies: [typoCss] },
112
+ { component: "ReadMore", main: "read-more.css", dependencies: [typoCss] },
113
+ { component: "Search", main: formCss, dependencies: [typoCss] },
114
+ { component: "Select", main: formCss, dependencies: [typoCss] },
115
+ { component: "Stepper", main: "stepper.css", dependencies: [typoCss] },
116
+ { component: "Switch", main: formCss, dependencies: [typoCss] },
117
+ { component: "Table", main: "table.css", dependencies: [typoCss] },
118
+ { component: "Tabs", main: "tabs.css", dependencies: [typoCss] },
119
+ { component: "Tag", main: "tag.css", dependencies: [typoCss] },
120
+ { component: "TextField", main: formCss, dependencies: [typoCss] },
121
+ { component: "Textarea", main: formCss, dependencies: [typoCss] },
122
+ {
123
+ component: "ToggleGroup",
124
+ main: "toggle-group.css",
125
+ dependencies: [typoCss],
126
+ },
127
+ { component: "Tooltip", main: "tooltip.css", dependencies: [typoCss] },
128
+ {
129
+ component: "UNSAFE_DatePicker",
130
+ main: "date.css",
131
+ dependencies: [typoCss, "button.css", "popover.css"],
132
+ },
133
+ {
134
+ component: "UNSAFE_MonthPicker",
135
+ main: "date.css",
136
+ dependencies: [typoCss, "button.css", "popover.css"],
137
+ },
138
+ ],
139
+ };
140
+
141
+ module.exports = {
142
+ StyleMappings,
143
+ typoCss,
144
+ formCss,
145
+ componentsCss,
146
+ rootDir,
147
+ globalDir,
148
+ componentDir,
149
+ };
@@ -0,0 +1,4 @@
1
+ const packageJson = require("../package.json");
2
+
3
+ /* Make package-version accessible for github-workflow */
4
+ console.log(packageJson.version);