@navikt/ds-css 2.8.11 → 2.8.12-beta.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 +2 -0
- package/baseline/baseline.css +47 -6
- package/baseline/index.css +5 -0
- package/baseline/reset.css +351 -0
- package/baseline/tokens.css +1 -0
- package/config/bundle.js +135 -0
- package/config/mappings.js +139 -0
- package/dist/accordion.css +74 -0
- package/dist/accordion.min.css +1 -0
- package/dist/alert.css +76 -0
- package/dist/alert.min.css +1 -0
- package/dist/baseline.css +102 -0
- package/dist/baseline.min.css +1 -0
- package/dist/button.css +352 -0
- package/dist/button.min.css +1 -0
- package/dist/chat.css +98 -0
- package/dist/chat.min.css +1 -0
- package/dist/chips.css +138 -0
- package/dist/chips.min.css +1 -0
- package/dist/contentcontainer.css +17 -0
- package/dist/contentcontainer.min.css +1 -0
- package/dist/date.css +220 -0
- package/dist/date.min.css +1 -0
- package/dist/expansioncard.css +197 -0
- package/dist/expansioncard.min.css +3 -0
- package/dist/fonts.css +21 -0
- package/dist/fonts.min.css +1 -0
- package/dist/forms.css +731 -0
- package/dist/forms.min.css +1 -0
- package/dist/grid.css +217 -0
- package/dist/grid.min.css +1 -0
- package/dist/guidepanel.css +62 -0
- package/dist/guidepanel.min.css +1 -0
- package/dist/helptext.css +45 -0
- package/dist/helptext.min.css +1 -0
- package/dist/index.css +54 -51
- package/dist/index.min.css +5 -0
- package/dist/link.css +37 -0
- package/dist/link.min.css +1 -0
- package/dist/linkpanel.css +38 -0
- package/dist/linkpanel.min.css +1 -0
- package/dist/list.css +66 -0
- package/dist/list.min.css +1 -0
- package/dist/loader.css +113 -0
- package/dist/loader.min.css +1 -0
- package/dist/modal.css +61 -0
- package/dist/modal.min.css +1 -0
- package/dist/pagination.css +60 -0
- package/dist/pagination.min.css +1 -0
- package/dist/panel.css +10 -0
- package/dist/panel.min.css +1 -0
- package/dist/popover.css +54 -0
- package/dist/popover.min.css +1 -0
- package/dist/print.css +75 -0
- package/dist/print.min.css +1 -0
- package/dist/readmore.css +63 -0
- package/dist/readmore.min.css +1 -0
- package/dist/reset.css +351 -0
- package/dist/reset.min.css +1 -0
- package/dist/stepper.css +225 -0
- package/dist/stepper.min.css +1 -0
- package/dist/table.css +227 -0
- package/dist/table.min.css +1 -0
- package/dist/tabs.css +114 -0
- package/dist/tabs.min.css +1 -0
- package/dist/tag.css +116 -0
- package/dist/tag.min.css +1 -0
- package/dist/togglegroup.css +100 -0
- package/dist/togglegroup.min.css +1 -0
- package/dist/tokens.css +279 -0
- package/dist/tokens.min.css +1 -0
- package/dist/tooltip.css +53 -0
- package/dist/tooltip.min.css +1 -0
- package/dist/typography.css +160 -0
- package/dist/typography.min.css +1 -0
- package/dist/version/2.8.12/Components.css +3268 -0
- package/dist/version/2.8.12/Components.min.css +3 -0
- package/dist/version/2.8.12/accordion.css +74 -0
- package/dist/version/2.8.12/accordion.min.css +1 -0
- package/dist/version/2.8.12/alert.css +76 -0
- package/dist/version/2.8.12/alert.min.css +1 -0
- package/dist/version/2.8.12/baseline.css +102 -0
- package/dist/version/2.8.12/baseline.min.css +1 -0
- package/dist/version/2.8.12/button.css +352 -0
- package/dist/version/2.8.12/button.min.css +1 -0
- package/dist/version/2.8.12/chat.css +98 -0
- package/dist/version/2.8.12/chat.min.css +1 -0
- package/dist/version/2.8.12/chips.css +138 -0
- package/dist/version/2.8.12/chips.min.css +1 -0
- package/dist/version/2.8.12/contentcontainer.css +17 -0
- package/dist/version/2.8.12/contentcontainer.min.css +1 -0
- package/dist/version/2.8.12/date.css +220 -0
- package/dist/version/2.8.12/date.min.css +1 -0
- package/dist/version/2.8.12/expansioncard.css +197 -0
- package/dist/version/2.8.12/expansioncard.min.css +3 -0
- package/dist/version/2.8.12/fonts.css +21 -0
- package/dist/version/2.8.12/fonts.min.css +1 -0
- package/dist/version/2.8.12/forms.css +731 -0
- package/dist/version/2.8.12/forms.min.css +1 -0
- package/dist/version/2.8.12/grid.css +217 -0
- package/dist/version/2.8.12/grid.min.css +1 -0
- package/dist/version/2.8.12/guidepanel.css +62 -0
- package/dist/version/2.8.12/guidepanel.min.css +1 -0
- package/dist/version/2.8.12/helptext.css +45 -0
- package/dist/version/2.8.12/helptext.min.css +1 -0
- package/dist/version/2.8.12/link.css +37 -0
- package/dist/version/2.8.12/link.min.css +1 -0
- package/dist/version/2.8.12/linkpanel.css +38 -0
- package/dist/version/2.8.12/linkpanel.min.css +1 -0
- package/dist/version/2.8.12/list.css +66 -0
- package/dist/version/2.8.12/list.min.css +1 -0
- package/dist/version/2.8.12/loader.css +113 -0
- package/dist/version/2.8.12/loader.min.css +1 -0
- package/dist/version/2.8.12/modal.css +61 -0
- package/dist/version/2.8.12/modal.min.css +1 -0
- package/dist/version/2.8.12/pagination.css +60 -0
- package/dist/version/2.8.12/pagination.min.css +1 -0
- package/dist/version/2.8.12/panel.css +10 -0
- package/dist/version/2.8.12/panel.min.css +1 -0
- package/dist/version/2.8.12/popover.css +54 -0
- package/dist/version/2.8.12/popover.min.css +1 -0
- package/dist/version/2.8.12/print.css +75 -0
- package/dist/version/2.8.12/print.min.css +1 -0
- package/dist/version/2.8.12/readmore.css +63 -0
- package/dist/version/2.8.12/readmore.min.css +1 -0
- package/dist/version/2.8.12/reset.css +351 -0
- package/dist/version/2.8.12/reset.min.css +1 -0
- package/dist/version/2.8.12/stepper.css +225 -0
- package/dist/version/2.8.12/stepper.min.css +1 -0
- package/dist/version/2.8.12/table.css +227 -0
- package/dist/version/2.8.12/table.min.css +1 -0
- package/dist/version/2.8.12/tabs.css +114 -0
- package/dist/version/2.8.12/tabs.min.css +1 -0
- package/dist/version/2.8.12/tag.css +116 -0
- package/dist/version/2.8.12/tag.min.css +1 -0
- package/dist/version/2.8.12/togglegroup.css +100 -0
- package/dist/version/2.8.12/togglegroup.min.css +1 -0
- package/dist/version/2.8.12/tokens.css +279 -0
- package/dist/version/2.8.12/tokens.min.css +1 -0
- package/dist/version/2.8.12/tooltip.css +53 -0
- package/dist/version/2.8.12/tooltip.min.css +1 -0
- package/dist/version/2.8.12/typography.css +160 -0
- package/dist/version/2.8.12/typography.min.css +1 -0
- package/index.css +1 -1
- package/package.json +15 -6
- package/typography.css +5 -4
- package/baseline/utility.css +0 -46
package/CHANGELOG.md
CHANGED
package/baseline/baseline.css
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
@import "@navikt/ds-tokens";
|
|
2
|
-
@import "normalize.css";
|
|
3
|
-
@import "fonts.css";
|
|
4
|
-
@import "print.css";
|
|
5
|
-
@import "utility.css";
|
|
6
|
-
|
|
7
1
|
html,
|
|
8
2
|
:host {
|
|
9
3
|
box-sizing: border-box;
|
|
@@ -58,3 +52,50 @@ button {
|
|
|
58
52
|
transition-delay: 0s !important;
|
|
59
53
|
}
|
|
60
54
|
}
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
* From https://github.com/h5bp/html5-boilerplate/blob/master/dist/css/style.css
|
|
58
|
+
*
|
|
59
|
+
* Hide only visually, but have it available for screen readers:
|
|
60
|
+
* https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
|
|
61
|
+
*
|
|
62
|
+
* 1. For long content, line feeds are not interpreted as spaces and small width
|
|
63
|
+
* causes content to wrap 1 word per line:
|
|
64
|
+
* https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
.sr-only,
|
|
68
|
+
.navds-sr-only {
|
|
69
|
+
border: 0;
|
|
70
|
+
clip: rect(0, 0, 0, 0);
|
|
71
|
+
height: 1px;
|
|
72
|
+
margin: -1px;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
padding: 0;
|
|
75
|
+
position: absolute;
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
width: 1px;
|
|
78
|
+
|
|
79
|
+
/* 1 */
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/*
|
|
83
|
+
* From https://github.com/h5bp/html5-boilerplate/blob/master/dist/css/style.css
|
|
84
|
+
*
|
|
85
|
+
* Extends the .sr-only class to allow the element
|
|
86
|
+
* to be focusable when navigated to via the keyboard:
|
|
87
|
+
* https://www.drupal.org/node/897638
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
.sr-only.focusable:active,
|
|
91
|
+
.sr-only.focusable:focus,
|
|
92
|
+
.navds-sr-only.focusable:active,
|
|
93
|
+
.navds-sr-only.focusable:focus {
|
|
94
|
+
clip: auto;
|
|
95
|
+
height: auto;
|
|
96
|
+
margin: 0;
|
|
97
|
+
overflow: visible;
|
|
98
|
+
position: static;
|
|
99
|
+
white-space: inherit;
|
|
100
|
+
width: auto;
|
|
101
|
+
}
|
|
@@ -0,0 +1,351 @@
|
|
|
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
|
+
* 1. Change the font styles in all browsers.
|
|
157
|
+
* 2. Remove the margin in Firefox and Safari.
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
button,
|
|
161
|
+
input,
|
|
162
|
+
optgroup,
|
|
163
|
+
select,
|
|
164
|
+
textarea {
|
|
165
|
+
font-family: inherit; /* 1 */
|
|
166
|
+
font-size: 100%; /* 1 */
|
|
167
|
+
line-height: 1.15; /* 1 */
|
|
168
|
+
margin: 0; /* 2 */
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Show the overflow in IE.
|
|
173
|
+
* 1. Show the overflow in Edge.
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
button,
|
|
177
|
+
input {
|
|
178
|
+
/* 1 */
|
|
179
|
+
overflow: visible;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
|
184
|
+
* 1. Remove the inheritance of text transform in Firefox.
|
|
185
|
+
*/
|
|
186
|
+
|
|
187
|
+
button,
|
|
188
|
+
select {
|
|
189
|
+
/* 1 */
|
|
190
|
+
text-transform: none;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Correct the inability to style clickable types in iOS and Safari.
|
|
195
|
+
*/
|
|
196
|
+
|
|
197
|
+
button,
|
|
198
|
+
[type="button"],
|
|
199
|
+
[type="reset"],
|
|
200
|
+
[type="submit"] {
|
|
201
|
+
-webkit-appearance: button;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Remove the inner border and padding in Firefox.
|
|
206
|
+
*/
|
|
207
|
+
|
|
208
|
+
button::-moz-focus-inner,
|
|
209
|
+
[type="button"]::-moz-focus-inner,
|
|
210
|
+
[type="reset"]::-moz-focus-inner,
|
|
211
|
+
[type="submit"]::-moz-focus-inner {
|
|
212
|
+
border-style: none;
|
|
213
|
+
padding: 0;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Restore the focus styles unset by the previous rule.
|
|
218
|
+
*/
|
|
219
|
+
|
|
220
|
+
button:-moz-focusring,
|
|
221
|
+
[type="button"]:-moz-focusring,
|
|
222
|
+
[type="reset"]:-moz-focusring,
|
|
223
|
+
[type="submit"]:-moz-focusring {
|
|
224
|
+
outline: 1px dotted ButtonText;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Correct the padding in Firefox.
|
|
229
|
+
*/
|
|
230
|
+
|
|
231
|
+
fieldset {
|
|
232
|
+
padding: 0.35em 0.75em 0.625em;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* 1. Correct the text wrapping in Edge and IE.
|
|
237
|
+
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
|
238
|
+
* 3. Remove the padding so developers are not caught out when they zero out
|
|
239
|
+
* `fieldset` elements in all browsers.
|
|
240
|
+
*/
|
|
241
|
+
|
|
242
|
+
legend {
|
|
243
|
+
box-sizing: border-box; /* 1 */
|
|
244
|
+
color: inherit; /* 2 */
|
|
245
|
+
display: table; /* 1 */
|
|
246
|
+
max-width: 100%; /* 1 */
|
|
247
|
+
padding: 0; /* 3 */
|
|
248
|
+
white-space: normal; /* 1 */
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
|
253
|
+
*/
|
|
254
|
+
|
|
255
|
+
progress {
|
|
256
|
+
vertical-align: baseline;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Remove the default vertical scrollbar in IE 10+.
|
|
261
|
+
*/
|
|
262
|
+
|
|
263
|
+
textarea {
|
|
264
|
+
overflow: auto;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* 1. Add the correct box sizing in IE 10.
|
|
269
|
+
* 2. Remove the padding in IE 10.
|
|
270
|
+
*/
|
|
271
|
+
|
|
272
|
+
[type="checkbox"],
|
|
273
|
+
[type="radio"] {
|
|
274
|
+
box-sizing: border-box; /* 1 */
|
|
275
|
+
padding: 0; /* 2 */
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Correct the cursor style of increment and decrement buttons in Chrome.
|
|
280
|
+
*/
|
|
281
|
+
|
|
282
|
+
[type="number"]::-webkit-inner-spin-button,
|
|
283
|
+
[type="number"]::-webkit-outer-spin-button {
|
|
284
|
+
height: auto;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* 1. Correct the odd appearance in Chrome and Safari.
|
|
289
|
+
* 2. Correct the outline style in Safari.
|
|
290
|
+
*/
|
|
291
|
+
|
|
292
|
+
[type="search"] {
|
|
293
|
+
-webkit-appearance: textfield; /* 1 */
|
|
294
|
+
outline-offset: -2px; /* 2 */
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Remove the inner padding in Chrome and Safari on macOS.
|
|
299
|
+
*/
|
|
300
|
+
|
|
301
|
+
[type="search"]::-webkit-search-decoration {
|
|
302
|
+
-webkit-appearance: none;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* 1. Correct the inability to style clickable types in iOS and Safari.
|
|
307
|
+
* 2. Change font properties to `inherit` in Safari.
|
|
308
|
+
*/
|
|
309
|
+
|
|
310
|
+
::-webkit-file-upload-button {
|
|
311
|
+
-webkit-appearance: button; /* 1 */
|
|
312
|
+
font: inherit; /* 2 */
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/* Interactive
|
|
316
|
+
========================================================================== */
|
|
317
|
+
|
|
318
|
+
/*
|
|
319
|
+
* Add the correct display in Edge, IE 10+, and Firefox.
|
|
320
|
+
*/
|
|
321
|
+
|
|
322
|
+
details {
|
|
323
|
+
display: block;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/*
|
|
327
|
+
* Add the correct display in all browsers.
|
|
328
|
+
*/
|
|
329
|
+
|
|
330
|
+
summary {
|
|
331
|
+
display: list-item;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/* Misc
|
|
335
|
+
========================================================================== */
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Add the correct display in IE 10+.
|
|
339
|
+
*/
|
|
340
|
+
|
|
341
|
+
template {
|
|
342
|
+
display: none;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Add the correct display in IE 10.
|
|
347
|
+
*/
|
|
348
|
+
|
|
349
|
+
[hidden] {
|
|
350
|
+
display: none;
|
|
351
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "@navikt/ds-tokens";
|
package/config/bundle.js
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
const fastglob = require("fast-glob");
|
|
4
|
+
const { camelCase } = require("lodash");
|
|
5
|
+
const postcss = require("postcss");
|
|
6
|
+
const autoprefixer = require("autoprefixer");
|
|
7
|
+
const combineSelectors = require("postcss-combine-duplicated-selectors");
|
|
8
|
+
const cssImports = require("postcss-import");
|
|
9
|
+
const cssnano = require("cssnano");
|
|
10
|
+
const version = require("../package.json").version;
|
|
11
|
+
const { StyleMappings } = require("./mappings.js");
|
|
12
|
+
|
|
13
|
+
run();
|
|
14
|
+
|
|
15
|
+
async function run() {
|
|
16
|
+
if (!fs.existsSync(path.resolve(__dirname, "../dist"))) {
|
|
17
|
+
fs.mkdirSync(path.resolve(__dirname, "../dist"));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (!fs.existsSync(path.resolve(__dirname, `../dist/version/${version}`))) {
|
|
21
|
+
fs.mkdirSync(path.resolve(__dirname, `../dist/version/${version}`), {
|
|
22
|
+
recursive: true,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
await bundleMonolith();
|
|
27
|
+
await bundleComponents();
|
|
28
|
+
await bundleFragments();
|
|
29
|
+
await bundleMinified();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Postcss-plugins
|
|
34
|
+
* - cssImports: Handle inline of imports from other css files
|
|
35
|
+
* - combineSelectors: Combine selectors with the same properties
|
|
36
|
+
*/
|
|
37
|
+
async function bundleMonolith() {
|
|
38
|
+
const indexSrc = path.resolve(__dirname, "../index.css");
|
|
39
|
+
const indexDist = path.resolve(__dirname, "../dist/index.css");
|
|
40
|
+
|
|
41
|
+
return fs.readFile(indexSrc, (_, css) => {
|
|
42
|
+
postcss([cssImports, combineSelectors])
|
|
43
|
+
.process(css, { from: indexSrc, to: indexDist })
|
|
44
|
+
.then((result) => {
|
|
45
|
+
fs.writeFileSync(indexDist, result.css, () => true);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Bundle Components together for flexible import-options
|
|
52
|
+
*/
|
|
53
|
+
async function bundleComponents() {
|
|
54
|
+
const indexSrc = path.resolve(__dirname, "../index.css");
|
|
55
|
+
const indexDist = path.resolve(__dirname, "../dist/Components.css");
|
|
56
|
+
|
|
57
|
+
return fs.readFile(indexSrc, (_, css) => {
|
|
58
|
+
/* Remove @charset, baseline */
|
|
59
|
+
const cssString = css.toString().split("\n").slice(2).join("\n");
|
|
60
|
+
postcss([cssImports, combineSelectors])
|
|
61
|
+
.process(cssString, { from: indexSrc, to: indexDist })
|
|
62
|
+
.then((result) => {
|
|
63
|
+
fs.writeFileSync(
|
|
64
|
+
indexDist.replace("dist", `dist/version/${version}`),
|
|
65
|
+
result.css,
|
|
66
|
+
() => true
|
|
67
|
+
);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Postcss-plugins
|
|
74
|
+
* - cssImports: Handle inline of imports from other css files
|
|
75
|
+
* - combineSelectors: Combine selectors with the same properties
|
|
76
|
+
*/
|
|
77
|
+
async function bundleFragments() {
|
|
78
|
+
const files = fastglob
|
|
79
|
+
.sync("*.css", { cwd: ".", ignore: "**/*.min.css" })
|
|
80
|
+
.map((fileN) => path.basename(fileN))
|
|
81
|
+
.filter((x) => x !== "index.css")
|
|
82
|
+
.map((x) => ({
|
|
83
|
+
input: path.resolve(__dirname, `../${x}`),
|
|
84
|
+
output: path.resolve(
|
|
85
|
+
__dirname,
|
|
86
|
+
`../dist/${camelCase(x.replace("css", ""))
|
|
87
|
+
.toLowerCase()
|
|
88
|
+
.replace(/ /g, "")}.css`
|
|
89
|
+
),
|
|
90
|
+
}));
|
|
91
|
+
|
|
92
|
+
StyleMappings.baseline.forEach(({ main }) => {
|
|
93
|
+
files.push({ input: `baseline/${main}`, output: `dist/${main}` });
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
files.push({ input: "form/index.css", output: "dist/forms.css" });
|
|
97
|
+
|
|
98
|
+
for (let file of files) {
|
|
99
|
+
const css = fs.readFileSync(file.input, { encoding: "utf-8" });
|
|
100
|
+
await postcss([cssImports, combineSelectors])
|
|
101
|
+
.process(css, { from: file.input, to: file.output })
|
|
102
|
+
.then((result) => {
|
|
103
|
+
fs.writeFileSync(file.output, result.css, () => true);
|
|
104
|
+
fs.writeFileSync(
|
|
105
|
+
file.output.replace("dist", `dist/version/${version}`),
|
|
106
|
+
result.css,
|
|
107
|
+
() => true
|
|
108
|
+
);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Give a minified version of of CSS for CDN and static imports
|
|
115
|
+
* Postcss-plugins
|
|
116
|
+
* - autoprefixer: Add vendor prefixes, uses browserlist in package.json
|
|
117
|
+
* - cssnano: css-minification
|
|
118
|
+
*/
|
|
119
|
+
async function bundleMinified() {
|
|
120
|
+
const files = fastglob
|
|
121
|
+
.sync("**/*.css", { cwd: "./dist", ignore: "**/*.min.css" })
|
|
122
|
+
.map((x) => ({
|
|
123
|
+
input: `dist/${x}`,
|
|
124
|
+
output: `dist/${x}`.replace("css", "min.css"),
|
|
125
|
+
}));
|
|
126
|
+
|
|
127
|
+
for (let file of files) {
|
|
128
|
+
const css = fs.readFileSync(file.input, { encoding: "utf-8" });
|
|
129
|
+
await postcss([autoprefixer, cssnano])
|
|
130
|
+
.process(css, { from: file.input, to: file.output })
|
|
131
|
+
.then((result) => {
|
|
132
|
+
fs.writeFileSync(file.output, result.css, () => true);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
const typoCss = "typography.css";
|
|
2
|
+
const formCss = "form.css";
|
|
3
|
+
const componentsCss = "components.css";
|
|
4
|
+
|
|
5
|
+
const StyleMappings = {
|
|
6
|
+
prioritzedCss: [typoCss, formCss],
|
|
7
|
+
baseline: [
|
|
8
|
+
{
|
|
9
|
+
main: "fonts.css",
|
|
10
|
+
optional: false,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
main: "tokens.css",
|
|
14
|
+
optional: false,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
main: "reset.css",
|
|
18
|
+
optional: true,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
main: "baseline.css",
|
|
22
|
+
optional: false,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
main: "print.css",
|
|
26
|
+
optional: true,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
components: [
|
|
30
|
+
{
|
|
31
|
+
component: "Accordion",
|
|
32
|
+
main: "accordion.css",
|
|
33
|
+
dependencies: [typoCss],
|
|
34
|
+
},
|
|
35
|
+
{ component: "Alert", main: "alert.css", dependencies: [typoCss] },
|
|
36
|
+
{
|
|
37
|
+
component: "BodyLong",
|
|
38
|
+
main: typoCss,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
component: "BodyShort",
|
|
42
|
+
main: typoCss,
|
|
43
|
+
dependencies: [typoCss],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
component: "Button",
|
|
47
|
+
main: "button.css",
|
|
48
|
+
dependencies: [typoCss, "loader.css"],
|
|
49
|
+
},
|
|
50
|
+
{ component: "Cell", main: "grid.css" },
|
|
51
|
+
{ component: "Chat", main: "chat.css", dependencies: [typoCss] },
|
|
52
|
+
{ component: "Checkbox", main: formCss, dependencies: [typoCss] },
|
|
53
|
+
{ component: "CheckboxGroup", main: formCss, dependencies: [typoCss] },
|
|
54
|
+
{ component: "Chips", main: "chips.css", dependencies: [typoCss] },
|
|
55
|
+
{
|
|
56
|
+
component: "ConfirmationPanel",
|
|
57
|
+
main: formCss,
|
|
58
|
+
dependencies: [typoCss],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
component: "ContentContainer",
|
|
62
|
+
main: "content-container.css",
|
|
63
|
+
},
|
|
64
|
+
{ component: "Detail", main: typoCss },
|
|
65
|
+
{ component: "ErrorMessage", main: typoCss },
|
|
66
|
+
{ component: "ErrorSummary", main: formCss, dependencies: [typoCss] },
|
|
67
|
+
{
|
|
68
|
+
component: "ExpansionCard",
|
|
69
|
+
main: "expansion-card.css",
|
|
70
|
+
dependencies: [typoCss],
|
|
71
|
+
},
|
|
72
|
+
{ component: "Fieldset", main: formCss, dependencies: [typoCss] },
|
|
73
|
+
{ component: "Grid", main: "grid.css", dependencies: [typoCss] },
|
|
74
|
+
{
|
|
75
|
+
component: "GuidePanel",
|
|
76
|
+
main: "guide-panel.css",
|
|
77
|
+
dependencies: [typoCss],
|
|
78
|
+
},
|
|
79
|
+
{ component: "Heading", main: typoCss, dependencies: [typoCss] },
|
|
80
|
+
{
|
|
81
|
+
component: "HelpText",
|
|
82
|
+
main: "help-text.css",
|
|
83
|
+
dependencies: ["popover.css"],
|
|
84
|
+
},
|
|
85
|
+
{ component: "Ingress", main: typoCss },
|
|
86
|
+
{ component: "Label", main: typoCss },
|
|
87
|
+
{ component: "Link", main: "link.css", dependencies: [typoCss] },
|
|
88
|
+
{
|
|
89
|
+
component: "LinkPanel",
|
|
90
|
+
main: "link-panel.css",
|
|
91
|
+
dependencies: [typoCss, "panel.css"],
|
|
92
|
+
},
|
|
93
|
+
{ component: "List", main: "list.css", dependencies: [typoCss] },
|
|
94
|
+
{ component: "Loader", main: "loader.css" },
|
|
95
|
+
{
|
|
96
|
+
component: "Modal",
|
|
97
|
+
main: "modal.css",
|
|
98
|
+
dependencies: ["button.css"],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
component: "Pagination",
|
|
102
|
+
main: "pagination.css",
|
|
103
|
+
dependencies: [typoCss, "button.css"],
|
|
104
|
+
},
|
|
105
|
+
{ component: "Panel", main: "panel.css" },
|
|
106
|
+
{ component: "Popover", main: "popover.css" },
|
|
107
|
+
{ component: "Provider", main: "" },
|
|
108
|
+
{ component: "Radio", main: formCss, dependencies: [typoCss] },
|
|
109
|
+
{ component: "RadioGroup", main: formCss, dependencies: [typoCss] },
|
|
110
|
+
{ component: "ReadMore", main: "read-more.css", dependencies: [typoCss] },
|
|
111
|
+
{ component: "Search", main: formCss, dependencies: [typoCss] },
|
|
112
|
+
{ component: "Select", main: formCss, dependencies: [typoCss] },
|
|
113
|
+
{ component: "Stepper", main: "stepper.css", dependencies: [typoCss] },
|
|
114
|
+
{ component: "Switch", main: formCss, dependencies: [typoCss] },
|
|
115
|
+
{ component: "Table", main: "table.css", dependencies: [typoCss] },
|
|
116
|
+
{ component: "Tabs", main: "tabs.css", dependencies: [typoCss] },
|
|
117
|
+
{ component: "Tag", main: "tag.css", dependencies: [typoCss] },
|
|
118
|
+
{ component: "TextField", main: formCss, dependencies: [typoCss] },
|
|
119
|
+
{ component: "Textarea", main: formCss, dependencies: [typoCss] },
|
|
120
|
+
{
|
|
121
|
+
component: "ToggleGroup",
|
|
122
|
+
main: "toggle-group.css",
|
|
123
|
+
dependencies: [typoCss],
|
|
124
|
+
},
|
|
125
|
+
{ component: "Tooltip", main: "tooltip.css", dependencies: [typoCss] },
|
|
126
|
+
{
|
|
127
|
+
component: "UNSAFE_DatePicker",
|
|
128
|
+
main: "date.css",
|
|
129
|
+
dependencies: [typoCss, "button.css", "popover.css"],
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
component: "UNSAFE_MonthPicker",
|
|
133
|
+
main: "date.css",
|
|
134
|
+
dependencies: [typoCss, "button.css", "popover.css"],
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
module.exports = { StyleMappings, typoCss, formCss, componentsCss };
|