@oslokommune/punkt-css 0.18.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/CHANGELOG.md +260 -0
- package/CONTRIBUTING.md +116 -0
- package/LICENSE +23 -0
- package/README.md +221 -0
- package/dist/css/components/alert.css +111 -0
- package/dist/css/components/alert.min.css +1 -0
- package/dist/css/components/backlink.css +38 -0
- package/dist/css/components/backlink.min.css +1 -0
- package/dist/css/components/badge.css +52 -0
- package/dist/css/components/badge.min.css +1 -0
- package/dist/css/components/breadcrumbs.css +116 -0
- package/dist/css/components/breadcrumbs.min.css +1 -0
- package/dist/css/components/footer.css +48 -0
- package/dist/css/components/footer.min.css +1 -0
- package/dist/css/components/header.css +123 -0
- package/dist/css/components/header.min.css +1 -0
- package/dist/css/components/icon.css +63 -0
- package/dist/css/components/icon.min.css +1 -0
- package/dist/css/components/teaserlist.css +53 -0
- package/dist/css/components/teaserlist.min.css +1 -0
- package/dist/css/pkt-base.css +9721 -0
- package/dist/css/pkt-base.min.css +1 -0
- package/dist/css/pkt-components.css +611 -0
- package/dist/css/pkt-components.min.css +1 -0
- package/dist/css/pkt-elements.css +881 -0
- package/dist/css/pkt-elements.min.css +1 -0
- package/dist/css/pkt-normalise.css +221 -0
- package/dist/css/pkt-normalise.min.css +1 -0
- package/dist/css/pkt.css +11415 -0
- package/dist/css/pkt.min.css +1 -0
- package/dist/scss/abstracts/_index.scss +3 -0
- package/dist/scss/abstracts/functions/_index.scss +65 -0
- package/dist/scss/abstracts/mixins/_breakpoints.scss +60 -0
- package/dist/scss/abstracts/mixins/_index.scss +2 -0
- package/dist/scss/abstracts/mixins/_typography.scss +45 -0
- package/dist/scss/abstracts/placeholders/_index.scss +19 -0
- package/dist/scss/abstracts/variables/_breakpoints.scss +8 -0
- package/dist/scss/abstracts/variables/_colors.scss +55 -0
- package/dist/scss/abstracts/variables/_index.scss +24 -0
- package/dist/scss/abstracts/variables/_spacing.scss +22 -0
- package/dist/scss/abstracts/variables/_typography.scss +430 -0
- package/dist/scss/base/_accessibility.scss +11 -0
- package/dist/scss/base/_colors.scss +24 -0
- package/dist/scss/base/_containers.scss +75 -0
- package/dist/scss/base/_defaults.scss +48 -0
- package/dist/scss/base/_grid.scss +114 -0
- package/dist/scss/base/_index.scss +9 -0
- package/dist/scss/base/_oslo-sans.scss +21 -0
- package/dist/scss/base/_spacing.scss +109 -0
- package/dist/scss/base/_typography.scss +102 -0
- package/dist/scss/base/_visibility.scss +28 -0
- package/dist/scss/components/_alert.scss +153 -0
- package/dist/scss/components/_backlink.scss +50 -0
- package/dist/scss/components/_badge.scss +59 -0
- package/dist/scss/components/_breadcrumbs.scss +130 -0
- package/dist/scss/components/_footer.scss +52 -0
- package/dist/scss/components/_header.scss +125 -0
- package/dist/scss/components/_icon.scss +83 -0
- package/dist/scss/components/_index.scss +8 -0
- package/dist/scss/components/_teaserlist.scss +56 -0
- package/dist/scss/elements/_button.scss +412 -0
- package/dist/scss/elements/_form.scss +190 -0
- package/dist/scss/elements/_hr.scss +8 -0
- package/dist/scss/elements/_image.scss +32 -0
- package/dist/scss/elements/_index.scss +8 -0
- package/dist/scss/elements/_list.scss +104 -0
- package/dist/scss/elements/_section.scss +98 -0
- package/dist/scss/elements/_select.scss +82 -0
- package/dist/scss/elements/_table.scss +80 -0
- package/dist/scss/normalise/_index.scss +241 -0
- package/dist/scss/pkt-base.scss +4 -0
- package/dist/scss/pkt-components.scss +4 -0
- package/dist/scss/pkt-elements.scss +4 -0
- package/dist/scss/pkt-normalise.scss +4 -0
- package/dist/scss/pkt.scss +13 -0
- package/index.js +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
/* Button element!
|
|
2
|
+
*
|
|
3
|
+
* Size: small, medium, large
|
|
4
|
+
* Skin: primary, secondary, tertiary, flat, primary-confirm
|
|
5
|
+
* State: normal, focus, hover, active, disabled
|
|
6
|
+
* Variant: label-only, icon-left, icon-right, icon-only
|
|
7
|
+
* Mode: light, dark
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
@use 'sass:map';
|
|
11
|
+
@use 'sass:selector';
|
|
12
|
+
@use '../abstracts/variables';
|
|
13
|
+
@use '../abstracts/placeholders';
|
|
14
|
+
|
|
15
|
+
$-module-name: 'pkt-btn';
|
|
16
|
+
$-sizes: (
|
|
17
|
+
'medium': (
|
|
18
|
+
'font-size': 'size-18',
|
|
19
|
+
'line-height': 1.5em,
|
|
20
|
+
'padding': 0.625rem 0.9375rem,
|
|
21
|
+
'icon-m-icon-left': 0.09375rem 0.3125rem 0 0,
|
|
22
|
+
'icon-m-icon-right': 0.09375rem 0 0 0.3125rem,
|
|
23
|
+
'icon-m-icon-only': 0.09375rem -0.21875rem,
|
|
24
|
+
'icon-size': 1.5rem,
|
|
25
|
+
),
|
|
26
|
+
'small': (
|
|
27
|
+
'font-size': 'size-16',
|
|
28
|
+
'line-height': 1.5em,
|
|
29
|
+
'padding': 0.3125rem 0.625rem,
|
|
30
|
+
'icon-m-icon-left': 0 0.3125rem 0 0,
|
|
31
|
+
'icon-m-icon-right': 0 0 0 0.3125rem,
|
|
32
|
+
'icon-m-icon-only': 0 -0.3125rem,
|
|
33
|
+
'icon-size': 1.5rem,
|
|
34
|
+
),
|
|
35
|
+
'large': (
|
|
36
|
+
'font-size': 'size-24',
|
|
37
|
+
'line-height': 1.4166666667em,
|
|
38
|
+
'padding': 0.9375rem 1.25rem,
|
|
39
|
+
'icon-m-icon-left': 0.0625rem 0.625rem 0 0,
|
|
40
|
+
'icon-m-icon-right': 0.0625rem 0 0 0.625rem,
|
|
41
|
+
'icon-m-icon-only': 0.0625rem -0.25rem,
|
|
42
|
+
'icon-size': 2rem,
|
|
43
|
+
),
|
|
44
|
+
);
|
|
45
|
+
$-skins: (
|
|
46
|
+
'primary': (
|
|
47
|
+
'light': (
|
|
48
|
+
'link-bg': --color-blue-dark,
|
|
49
|
+
'link-bc': --color-blue-dark,
|
|
50
|
+
'link-txt': --color-white,
|
|
51
|
+
'focus-bg': --color-active,
|
|
52
|
+
'focus-bc': --color-active,
|
|
53
|
+
'focus-txt': --color-white,
|
|
54
|
+
'hover-bg': --color-active,
|
|
55
|
+
'hover-bc': --color-active,
|
|
56
|
+
'hover-txt': --color-white,
|
|
57
|
+
'active-bg': --color-active,
|
|
58
|
+
'active-bc': --color-active,
|
|
59
|
+
'active-txt': --color-white,
|
|
60
|
+
'disabled-bg': --color-gray,
|
|
61
|
+
'disabled-bc': --color-gray,
|
|
62
|
+
'disabled-txt': --color-grayscale-30,
|
|
63
|
+
),
|
|
64
|
+
'dark': (
|
|
65
|
+
'link-bg': --color-blue-light,
|
|
66
|
+
'link-bc': --color-blue-light,
|
|
67
|
+
'link-txt': --color-blue-dark,
|
|
68
|
+
'focus-bg': --color-blue,
|
|
69
|
+
'focus-bc': --color-blue,
|
|
70
|
+
'focus-txt': --color-blue-dark,
|
|
71
|
+
'hover-bg': --color-blue,
|
|
72
|
+
'hover-bc': --color-blue,
|
|
73
|
+
'hover-txt': --color-blue-dark,
|
|
74
|
+
'active-bg': --color-blue,
|
|
75
|
+
'active-bc': --color-blue,
|
|
76
|
+
'active-txt': --color-blue-dark,
|
|
77
|
+
'disabled-bg': --color-gray,
|
|
78
|
+
'disabled-bc': --color-gray,
|
|
79
|
+
'disabled-txt': --color-grayscale-30,
|
|
80
|
+
),
|
|
81
|
+
),
|
|
82
|
+
'secondary': (
|
|
83
|
+
'light': (
|
|
84
|
+
'link-bg': --color-transparent,
|
|
85
|
+
'link-bc': --color-blue-dark,
|
|
86
|
+
'link-txt': --color-blue-dark,
|
|
87
|
+
'focus-bg': --color-transparent,
|
|
88
|
+
'focus-bc': --color-active,
|
|
89
|
+
'focus-txt': --color-active,
|
|
90
|
+
'hover-bg': --color-transparent,
|
|
91
|
+
'hover-bc': --color-active,
|
|
92
|
+
'hover-txt': --color-active,
|
|
93
|
+
'active-bg': --color-active,
|
|
94
|
+
'active-bc': --color-active,
|
|
95
|
+
'active-txt': --color-white,
|
|
96
|
+
'disabled-bg': --color-gray,
|
|
97
|
+
'disabled-bc': --color-gray,
|
|
98
|
+
'disabled-txt': --color-grayscale-30,
|
|
99
|
+
),
|
|
100
|
+
'dark': (
|
|
101
|
+
'link-bg': --color-transparent,
|
|
102
|
+
'link-bc': --color-white,
|
|
103
|
+
'link-txt': --color-white,
|
|
104
|
+
'focus-bg': --color-blue,
|
|
105
|
+
'focus-bc': --color-blue,
|
|
106
|
+
'focus-txt': --color-blue-dark,
|
|
107
|
+
'hover-bg': --color-transparent,
|
|
108
|
+
'hover-bc': --color-blue,
|
|
109
|
+
'hover-txt': --color-blue,
|
|
110
|
+
'active-bg': --color-blue,
|
|
111
|
+
'active-bc': --color-blue,
|
|
112
|
+
'active-txt': --color-blue-dark,
|
|
113
|
+
'disabled-bg': --color-gray,
|
|
114
|
+
'disabled-bc': --color-gray,
|
|
115
|
+
'disabled-txt': --color-grayscale-30,
|
|
116
|
+
),
|
|
117
|
+
),
|
|
118
|
+
'tertiary': (
|
|
119
|
+
'light': (
|
|
120
|
+
'link-bg': --color-transparent,
|
|
121
|
+
'link-bc': --color-yellow,
|
|
122
|
+
'link-txt': --color-blue-dark,
|
|
123
|
+
'focus-bg': --color-transparent,
|
|
124
|
+
'focus-bc': --color-active,
|
|
125
|
+
'focus-txt': --color-active,
|
|
126
|
+
'hover-bg': --color-transparent,
|
|
127
|
+
'hover-bc': --color-active,
|
|
128
|
+
'hover-txt': --color-active,
|
|
129
|
+
'active-bg': --color-active,
|
|
130
|
+
'active-bc': --color-active,
|
|
131
|
+
'active-txt': --color-white,
|
|
132
|
+
'disabled-bg': --color-gray,
|
|
133
|
+
'disabled-bc': --color-gray,
|
|
134
|
+
'disabled-txt': --color-grayscale-30,
|
|
135
|
+
),
|
|
136
|
+
'dark': (
|
|
137
|
+
'link-bg': --color-transparent,
|
|
138
|
+
'link-bc': --color-yellow,
|
|
139
|
+
'link-txt': --color-white,
|
|
140
|
+
'focus-bg': --color-transparent,
|
|
141
|
+
'focus-bc': --color-blue,
|
|
142
|
+
'focus-txt': --color-blue,
|
|
143
|
+
'hover-bg': --color-transparent,
|
|
144
|
+
'hover-bc': --color-blue,
|
|
145
|
+
'hover-txt': --color-blue,
|
|
146
|
+
'active-bg': --color-blue,
|
|
147
|
+
'active-bc': --color-blue,
|
|
148
|
+
'active-txt': --color-blue-dark,
|
|
149
|
+
'disabled-bg': --color-gray,
|
|
150
|
+
'disabled-bc': --color-gray,
|
|
151
|
+
'disabled-txt': --color-grayscale-30,
|
|
152
|
+
),
|
|
153
|
+
),
|
|
154
|
+
'flat': (
|
|
155
|
+
'light': (
|
|
156
|
+
'link-bg': --color-transparent,
|
|
157
|
+
'link-bc': --color-transparent,
|
|
158
|
+
'link-txt': --color-blue-dark,
|
|
159
|
+
'focus-bg': --color-gray,
|
|
160
|
+
'focus-bc': --color-gray,
|
|
161
|
+
'focus-txt': --color-active,
|
|
162
|
+
'hover-bg': --color-gray,
|
|
163
|
+
'hover-bc': --color-gray,
|
|
164
|
+
'hover-txt': --color-active,
|
|
165
|
+
'active-bg': --color-transparent,
|
|
166
|
+
'active-bc': --color-transparent,
|
|
167
|
+
'active-txt': --color-active,
|
|
168
|
+
'disabled-bg': --color-transparent,
|
|
169
|
+
'disabled-bc': --color-transparent,
|
|
170
|
+
'disabled-txt': --color-grayscale-30,
|
|
171
|
+
),
|
|
172
|
+
'dark': (
|
|
173
|
+
'link-bg': --color-transparent,
|
|
174
|
+
'link-bc': --color-transparent,
|
|
175
|
+
'link-txt': --color-white,
|
|
176
|
+
'focus-bg': --color-blue-5,
|
|
177
|
+
'focus-bc': --color-blue-5,
|
|
178
|
+
'focus-txt': --color-blue,
|
|
179
|
+
'hover-bg': --color-blue-5,
|
|
180
|
+
'hover-bc': --color-blue-5,
|
|
181
|
+
'hover-txt': --color-blue,
|
|
182
|
+
'active-bg': --color-transparent,
|
|
183
|
+
'active-bc': --color-transparent,
|
|
184
|
+
'active-txt': --color-blue,
|
|
185
|
+
'disabled-bg': --color-transparent,
|
|
186
|
+
'disabled-bc': --color-transparent,
|
|
187
|
+
'disabled-txt': --color-white,
|
|
188
|
+
),
|
|
189
|
+
),
|
|
190
|
+
'primary-confirm': (
|
|
191
|
+
'light': (
|
|
192
|
+
'link-bg': --color-green,
|
|
193
|
+
'link-bc': --color-green,
|
|
194
|
+
'link-txt': --color-blue-dark,
|
|
195
|
+
'focus-bg': --color-active,
|
|
196
|
+
'focus-bc': --color-active,
|
|
197
|
+
'focus-txt': --color-white,
|
|
198
|
+
'hover-bg': --color-active,
|
|
199
|
+
'hover-bc': --color-active,
|
|
200
|
+
'hover-txt': --color-white,
|
|
201
|
+
'active-bg': --color-active,
|
|
202
|
+
'active-bc': --color-active,
|
|
203
|
+
'active-txt': --color-white,
|
|
204
|
+
'disabled-bg': --color-gray,
|
|
205
|
+
'disabled-bc': --color-gray,
|
|
206
|
+
'disabled-txt': --color-grayscale-30,
|
|
207
|
+
),
|
|
208
|
+
'dark': (
|
|
209
|
+
'link-bg': --color-green,
|
|
210
|
+
'link-bc': --color-green,
|
|
211
|
+
'link-txt': --color-blue-dark,
|
|
212
|
+
'focus-bg': --color-blue,
|
|
213
|
+
'focus-bc': --color-blue,
|
|
214
|
+
'focus-txt': --color-blue-dark,
|
|
215
|
+
'hover-bg': --color-blue,
|
|
216
|
+
'hover-bc': --color-blue,
|
|
217
|
+
'hover-txt': --color-blue-dark,
|
|
218
|
+
'active-bg': --color-blue,
|
|
219
|
+
'active-bc': --color-blue,
|
|
220
|
+
'active-txt': --color-blue-dark,
|
|
221
|
+
'disabled-bg': --color-gray,
|
|
222
|
+
'disabled-bc': --color-gray,
|
|
223
|
+
'disabled-txt': --color-grayscale-30,
|
|
224
|
+
),
|
|
225
|
+
),
|
|
226
|
+
);
|
|
227
|
+
|
|
228
|
+
@mixin -print-skin-as-css-vars($name, $o, $mode) {
|
|
229
|
+
@each $key, $value in $o {
|
|
230
|
+
// Only print primary skin and css vars that differ from primary
|
|
231
|
+
@if $name == 'primary' or $value != map.get($-skins, 'primary', $mode, $key)
|
|
232
|
+
{
|
|
233
|
+
--btn-#{$key}: var(#{$value});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
@mixin -size($name, $o) {
|
|
239
|
+
@if $name == medium {
|
|
240
|
+
font-size: map.get(variables.$font-size, map.get($o, 'font-size'));
|
|
241
|
+
line-height: map.get($o, 'line-height');
|
|
242
|
+
padding: map.get($o, 'padding');
|
|
243
|
+
|
|
244
|
+
&__icon {
|
|
245
|
+
height: map.get($o, 'icon-size');
|
|
246
|
+
width: map.get($o, 'icon-size');
|
|
247
|
+
margin: map.get($o, 'icon-margin');
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// button variants (base)
|
|
251
|
+
&--label-only {
|
|
252
|
+
.#{$-module-name}__icon {
|
|
253
|
+
display: none;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
&--icon-left {
|
|
258
|
+
flex-direction: row;
|
|
259
|
+
|
|
260
|
+
.#{$-module-name}__icon {
|
|
261
|
+
margin: map.get($o, 'icon-m-icon-left');
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
&--icon-right {
|
|
266
|
+
flex-direction: row-reverse;
|
|
267
|
+
|
|
268
|
+
.#{$-module-name}__icon {
|
|
269
|
+
margin: map.get($o, 'icon-m-icon-right');
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
&--icon-only {
|
|
273
|
+
.#{$-module-name}__text {
|
|
274
|
+
@extend %sr-only;
|
|
275
|
+
}
|
|
276
|
+
.#{$-module-name}__icon {
|
|
277
|
+
margin: map.get($o, 'icon-m-icon-only');
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
} @else {
|
|
281
|
+
&--#{$name} {
|
|
282
|
+
font-size: map.get(variables.$font-size, map.get($o, 'font-size'));
|
|
283
|
+
line-height: map.get($o, 'line-height');
|
|
284
|
+
padding: map.get($o, 'padding');
|
|
285
|
+
}
|
|
286
|
+
&--#{$name} &__icon {
|
|
287
|
+
height: map.get($o, 'icon-size');
|
|
288
|
+
width: map.get($o, 'icon-size');
|
|
289
|
+
margin: map.get($o, 'icon-margin');
|
|
290
|
+
}
|
|
291
|
+
.#{$-module-name}--#{$name}.#{$-module-name}--icon-left &__icon {
|
|
292
|
+
margin: map.get($o, 'icon-m-icon-left');
|
|
293
|
+
}
|
|
294
|
+
.#{$-module-name}--#{$name}.#{$-module-name}--icon-right &__icon {
|
|
295
|
+
margin: map.get($o, 'icon-m-icon-right');
|
|
296
|
+
}
|
|
297
|
+
.#{$-module-name}--#{$name}.#{$-module-name}--icon-only &__icon {
|
|
298
|
+
margin: map.get($o, 'icon-m-icon-only');
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
@mixin -skin($name, $o) {
|
|
304
|
+
$css-skin: '';
|
|
305
|
+
@if $name != primary {
|
|
306
|
+
$css-skin: --#{$name};
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.#{$-module-name}#{$css-skin} {
|
|
310
|
+
@include -print-skin-as-css-vars(
|
|
311
|
+
$name,
|
|
312
|
+
map.get($-skins, $name, 'light'),
|
|
313
|
+
'light'
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
@at-root [data-mode='dark'] .#{$-module-name}#{$css-skin} {
|
|
317
|
+
@include -print-skin-as-css-vars(
|
|
318
|
+
$name,
|
|
319
|
+
map.get($-skins, $name, 'dark'),
|
|
320
|
+
'dark'
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Print css vars for hvert skin
|
|
326
|
+
@each $key, $value in $-skins {
|
|
327
|
+
@include -skin($key, map.get($value, 'light'));
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// Selve knappe-klassen
|
|
331
|
+
.#{$-module-name} {
|
|
332
|
+
border-radius: 0;
|
|
333
|
+
cursor: pointer;
|
|
334
|
+
display: inline-flex;
|
|
335
|
+
font-family: inherit;
|
|
336
|
+
font-weight: normal;
|
|
337
|
+
margin: 0;
|
|
338
|
+
overflow: hidden;
|
|
339
|
+
position: relative;
|
|
340
|
+
-moz-user-select: none;
|
|
341
|
+
-webkit-user-select: none;
|
|
342
|
+
-ms-user-select: none;
|
|
343
|
+
user-select: none;
|
|
344
|
+
vertical-align: top;
|
|
345
|
+
background-color: var(--btn-link-bg);
|
|
346
|
+
border: 2px solid var(--btn-link-bc);
|
|
347
|
+
color: var(--btn-link-txt);
|
|
348
|
+
text-decoration: none;
|
|
349
|
+
text-decoration-thickness: 1px;
|
|
350
|
+
text-underline-offset: 0.3em;
|
|
351
|
+
text-align: left;
|
|
352
|
+
|
|
353
|
+
&[class*='pkt-btn--icon'] > .pkt-btn__icon {
|
|
354
|
+
display: block;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
&__icon {
|
|
358
|
+
--fg-color: currentColor;
|
|
359
|
+
display: none;
|
|
360
|
+
flex-shrink: 0;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
&:link,
|
|
364
|
+
&:visited {
|
|
365
|
+
color: var(--btn-link-txt);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
@at-root a.#{$-module-name}:focus,
|
|
369
|
+
&:enabled:focus,
|
|
370
|
+
&.#{$-module-name}--focus {
|
|
371
|
+
background-color: var(--btn-focus-bg);
|
|
372
|
+
border-color: var(--btn-focus-bc);
|
|
373
|
+
color: var(--btn-focus-txt);
|
|
374
|
+
outline: 0;
|
|
375
|
+
text-decoration: underline;
|
|
376
|
+
}
|
|
377
|
+
@at-root a.#{$-module-name}:hover,
|
|
378
|
+
&:enabled:hover,
|
|
379
|
+
&.#{$-module-name}--hover {
|
|
380
|
+
background-color: var(--btn-hover-bg);
|
|
381
|
+
border-color: var(--btn-hover-bc);
|
|
382
|
+
color: var(--btn-hover-txt);
|
|
383
|
+
outline: 0;
|
|
384
|
+
text-decoration: underline;
|
|
385
|
+
}
|
|
386
|
+
@at-root a.#{$-module-name}:active,
|
|
387
|
+
&:enabled:active,
|
|
388
|
+
&.#{$-module-name}--active,
|
|
389
|
+
&.#{$-module-name}--active:hover {
|
|
390
|
+
background-color: var(--btn-active-bg);
|
|
391
|
+
border-color: var(--btn-active-bc);
|
|
392
|
+
color: var(--btn-active-txt);
|
|
393
|
+
outline: 0;
|
|
394
|
+
text-decoration: none;
|
|
395
|
+
}
|
|
396
|
+
&:disabled {
|
|
397
|
+
background-color: var(--btn-disabled-bg);
|
|
398
|
+
border-color: var(--btn-disabled-bc);
|
|
399
|
+
color: var(--btn-disabled-txt);
|
|
400
|
+
cursor: inherit;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// button sizes & variants
|
|
404
|
+
@each $key, $value in $-sizes {
|
|
405
|
+
@include -size($key, $value);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// Til slutt: dette er okay å gjøre siden vi spesifiserer en synlig focus state
|
|
409
|
+
&::-moz-focus-inner {
|
|
410
|
+
border: 0;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Form elements
|
|
3
|
+
* https://css-tricks.com/html-inputs-and-labels-a-love-story/
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
@use 'sass:map';
|
|
8
|
+
@use '../abstracts/variables';
|
|
9
|
+
@use '../abstracts/functions';
|
|
10
|
+
|
|
11
|
+
$-checkbox-img: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='none' stroke='#fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/></svg>") !default;
|
|
12
|
+
|
|
13
|
+
/* TODO: move to animation.scss */
|
|
14
|
+
@keyframes enter {
|
|
15
|
+
from {
|
|
16
|
+
transform: scaleY(0);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
to {
|
|
20
|
+
transform: scaleY(1);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* TODO: Contemplate and decide if this should be split up to multiple files or not.
|
|
25
|
+
* button is only one without pkt-form prefix. Is that ok???
|
|
26
|
+
*/
|
|
27
|
+
.pkt-form {
|
|
28
|
+
&-group {
|
|
29
|
+
margin-bottom: map.get(variables.$spacing, 'size-24');
|
|
30
|
+
|
|
31
|
+
&:focus-within {
|
|
32
|
+
color: var(--color-active);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* EXPLICIT LABEL (recommended for use)
|
|
37
|
+
* - the label is connected to an input via "for" and "id"
|
|
38
|
+
*/
|
|
39
|
+
&-label {
|
|
40
|
+
width: 100%;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&-help {
|
|
44
|
+
margin: 0.25em 0;
|
|
45
|
+
font-size: map.get(variables.$font-size, 'size-14');
|
|
46
|
+
line-height: 1.25em;
|
|
47
|
+
opacity: 0.9;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&-validation {
|
|
51
|
+
animation: enter 0.2s ease-in forwards;
|
|
52
|
+
background-color: var(--color-red);
|
|
53
|
+
border: 2px solid var(--color-red);
|
|
54
|
+
font-size: map.get(variables.$font-size, 'size-14');
|
|
55
|
+
line-height: 2rem;
|
|
56
|
+
margin: map.get(variables.$spacing, 'size-16') 0 0;
|
|
57
|
+
padding: 0.4375rem 0.5rem;
|
|
58
|
+
transform-origin: 0 0;
|
|
59
|
+
|
|
60
|
+
&--warning {
|
|
61
|
+
background-color: var(--color-yellow);
|
|
62
|
+
border-color: var(--color-yellow);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&--error {
|
|
66
|
+
background-color: var(--color-red);
|
|
67
|
+
border-color: var(--color-red);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&-input,
|
|
72
|
+
&-textarea {
|
|
73
|
+
appearance: none; // Fix appearance on date inputs in Safari
|
|
74
|
+
background-clip: padding-box;
|
|
75
|
+
background-color: var(--color-white);
|
|
76
|
+
border: 2px solid var(--color-blue-dark);
|
|
77
|
+
border-radius: 0;
|
|
78
|
+
color: var(--color-blue-dark);
|
|
79
|
+
display: block;
|
|
80
|
+
font-size: map.get(variables.$font-size, 'size-16');
|
|
81
|
+
font-weight: map.get(variables.$font-weight, 'regular');
|
|
82
|
+
height: 3.125rem;
|
|
83
|
+
line-height: 2rem;
|
|
84
|
+
margin: 0;
|
|
85
|
+
padding: 0.4375rem 0.5rem;
|
|
86
|
+
position: relative;
|
|
87
|
+
width: 100%;
|
|
88
|
+
|
|
89
|
+
&:focus {
|
|
90
|
+
background-color: var(--color-white);
|
|
91
|
+
border-color: var(--color-active);
|
|
92
|
+
box-shadow: 0 0 var(--color-active);
|
|
93
|
+
color: var(--color-active);
|
|
94
|
+
outline: 2px solid var(--color-active);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* Placeholder
|
|
98
|
+
* 1. Override Firefox's default opacity
|
|
99
|
+
*/
|
|
100
|
+
&::placeholder {
|
|
101
|
+
color: var(--color-grayscale-30);
|
|
102
|
+
opacity: 1; /* 1 */
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
& + .pkt-form-validation {
|
|
106
|
+
display: none;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&:not(:placeholder-shown):invalid {
|
|
110
|
+
border-color: var(--color-red);
|
|
111
|
+
|
|
112
|
+
& + .pkt-form-validation {
|
|
113
|
+
display: inherit;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&:disabled,
|
|
118
|
+
&[readonly] {
|
|
119
|
+
background-color: var(--color-gray);
|
|
120
|
+
border-color: var(--color-grayscale-30);
|
|
121
|
+
color: var(--color-grayscale-30);
|
|
122
|
+
cursor: inherit;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&[required],
|
|
126
|
+
&:required {
|
|
127
|
+
// TODO
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&-check-input {
|
|
132
|
+
appearance: none;
|
|
133
|
+
background-color: var(--color-white);
|
|
134
|
+
background-repeat: no-repeat;
|
|
135
|
+
background-position: center;
|
|
136
|
+
background-size: contain;
|
|
137
|
+
border: 2px solid var(--color-blue-dark);
|
|
138
|
+
display: inline-block;
|
|
139
|
+
margin: 0.125rem 0.25rem 0 0;
|
|
140
|
+
width: 1.25rem;
|
|
141
|
+
height: 1.25rem;
|
|
142
|
+
transition: all 0.3s ease-out;
|
|
143
|
+
vertical-align: top;
|
|
144
|
+
|
|
145
|
+
&[type='checkbox'] {
|
|
146
|
+
border-radius: 0;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&[type='radio'] {
|
|
150
|
+
border-radius: 50%;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&:hover {
|
|
154
|
+
border-color: var(--color-active);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&:active {
|
|
158
|
+
border-color: var(--color-active);
|
|
159
|
+
outline: 2px solid var(--color-active);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&:focus {
|
|
163
|
+
border-color: var(--color-active);
|
|
164
|
+
outline: 2px solid var(--color-hover);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&:checked {
|
|
168
|
+
&[type='radio'] {
|
|
169
|
+
background-color: var(--color-white);
|
|
170
|
+
border: 6px solid var(--color-active);
|
|
171
|
+
}
|
|
172
|
+
&[type='checkbox'] {
|
|
173
|
+
background-color: var(--color-active);
|
|
174
|
+
background-image: functions.escape-svg($-checkbox-img);
|
|
175
|
+
border-color: var(--color-active);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Disabled styles
|
|
180
|
+
&:disabled {
|
|
181
|
+
border-color: var(--color-grayscale-30);
|
|
182
|
+
cursor: not-allowed;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&:disabled ~ .pkt-form-label {
|
|
186
|
+
color: var(--color-grayscale-30);
|
|
187
|
+
cursor: not-allowed;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Image elements
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
DEBATE:
|
|
7
|
+
CSS reset in minside-frontend sets all images to be fluid by default. However, this breaks
|
|
8
|
+
a lot of third-party widgets like Google Maps, as they are not expecting the images within themselves
|
|
9
|
+
to be resized from the outside.
|
|
10
|
+
|
|
11
|
+
Therefore, this is removed from the reset here, and images who need to be fluid need a class for it.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
.img-fluid {
|
|
15
|
+
max-width: 100%;
|
|
16
|
+
height: auto;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.img-round {
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
object-fit: cover;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//
|
|
26
|
+
// Figure
|
|
27
|
+
//
|
|
28
|
+
|
|
29
|
+
.figure {
|
|
30
|
+
// Ensures the caption-text aligns with image.
|
|
31
|
+
display: inline-block;
|
|
32
|
+
}
|