@oslokommune/punkt-css 2.0.1 → 2.0.4
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 +24 -0
- package/dist/css/components/alert.css +59 -70
- package/dist/css/components/alert.min.css +1 -1
- package/dist/css/components/icon.css +0 -41
- package/dist/css/components/icon.min.css +1 -1
- package/dist/css/pkt-base.css +38 -0
- package/dist/css/pkt-base.min.css +1 -1
- package/dist/css/pkt-components.css +59 -111
- package/dist/css/pkt-components.min.css +1 -1
- package/dist/css/pkt-elements.css +17 -34
- package/dist/css/pkt-elements.min.css +1 -1
- package/dist/css/pkt.css +114 -145
- package/dist/css/pkt.min.css +1 -1
- package/dist/scss/abstracts/variables/_colors.scss +4 -0
- package/dist/scss/base/_defaults.scss +2 -0
- package/dist/scss/components/_alert.scss +64 -102
- package/dist/scss/components/_icon.scss +0 -54
- package/dist/scss/elements/_button.scss +24 -40
- package/package.json +3 -3
|
@@ -30,12 +30,16 @@ $colors: (
|
|
|
30
30
|
color-blue-dark-10: #d9e9f2,
|
|
31
31
|
color-blue-5: #f1fdff,
|
|
32
32
|
color-blue-10: #e5fcff,
|
|
33
|
+
color-blue-60: #cdf5fb,
|
|
33
34
|
color-green-dark-5: #f2fff3,
|
|
34
35
|
color-green-dark-10: #d9f2ef,
|
|
35
36
|
color-green-10: #e5ffe6,
|
|
37
|
+
color-green-30: #c0f6e3,
|
|
36
38
|
color-red-5: #fff3f2,
|
|
37
39
|
color-red-10: #ffe8e5,
|
|
40
|
+
color-red-30: #f9cfca,
|
|
38
41
|
color-yellow-5: #fef9f0,
|
|
42
|
+
color-yellow-50: #fae1b6,
|
|
39
43
|
// grayscale digital
|
|
40
44
|
color-gray-light: #f9f9f9,
|
|
41
45
|
color-gray: #f2f2f2,
|
|
@@ -6,132 +6,94 @@
|
|
|
6
6
|
@use '../abstracts/mixins/breakpoints' as *;
|
|
7
7
|
@use '../abstracts/' as *;
|
|
8
8
|
|
|
9
|
+
$-module-name: 'pkt-alert';
|
|
10
|
+
|
|
9
11
|
// Spacing
|
|
10
12
|
$-alert-spacing: map.get(variables.$spacing, 'size-24');
|
|
13
|
+
$-border-thickness: map.get(variables.$spacing, 'size-4');
|
|
14
|
+
|
|
15
|
+
// default is "info"
|
|
16
|
+
.#{$-module-name} {
|
|
17
|
+
--pkt-alert-bc: var(--color-blue);
|
|
18
|
+
--pkt-alert-bg: var(--color-blue-60);
|
|
19
|
+
--pkt-alert-txt: var(--color-blue-dark);
|
|
20
|
+
--pkt-alert-icon-fg: var(--color-blue-dark);
|
|
21
|
+
--pkt-alert-close-fg: var(--color-blue-dark);
|
|
22
|
+
}
|
|
23
|
+
.#{$-module-name}--error {
|
|
24
|
+
--pkt-alert-bc: var(--color-red);
|
|
25
|
+
--pkt-alert-bg: var(--color-red-30);
|
|
26
|
+
}
|
|
11
27
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// Error
|
|
18
|
-
$-alert-error-border: 3px solid $-alert-red-error;
|
|
19
|
-
$-alert-error-bg: map.get(variables.$colors, 'color-red-5');
|
|
20
|
-
$-alert-error-color: $-alert-red-error;
|
|
21
|
-
|
|
22
|
-
// Success
|
|
23
|
-
$-alert-success-border: 3px solid $-alert-green-dark;
|
|
24
|
-
$-alert-success-bg: map.get(variables.$colors, 'color-green-dark-5');
|
|
25
|
-
$-alert-success-color: $-alert-green-dark;
|
|
26
|
-
|
|
27
|
-
// Warning
|
|
28
|
-
$-alert-warning-border: 3px solid map.get(variables.$colors, 'color-yellow');
|
|
29
|
-
$-alert-warning-bg: map.get(variables.$colors, 'color-yellow-5');
|
|
30
|
-
$-alert-warning-color: map.get(variables.$colors, 'color-warning');
|
|
31
|
-
|
|
32
|
-
// Info
|
|
33
|
-
$-alert-info-border: 3px solid $-alert-blue-dark;
|
|
34
|
-
$-alert-info-bg: map.get(variables.$colors, 'color-blue-dark-5');
|
|
35
|
-
$-alert-info-color: $-alert-blue-dark;
|
|
28
|
+
.#{$-module-name}--success {
|
|
29
|
+
--pkt-alert-bc: var(--color-green);
|
|
30
|
+
--pkt-alert-bg: var(--color-green-30);
|
|
31
|
+
}
|
|
36
32
|
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
.#{$-module-name}--warning {
|
|
34
|
+
--pkt-alert-bc: var(--color-yellow);
|
|
35
|
+
--pkt-alert-bg: var(--color-yellow-50);
|
|
36
|
+
}
|
|
39
37
|
|
|
40
|
-
|
|
41
|
-
padding: $-alert-spacing
|
|
38
|
+
.#{$-module-name} {
|
|
39
|
+
padding: $-alert-spacing $-alert-spacing $-alert-spacing
|
|
40
|
+
calc($-alert-spacing - $-border-thickness);
|
|
42
41
|
display: block;
|
|
43
|
-
overflow: hidden;
|
|
44
42
|
position: relative;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
margin-bottom: 0;
|
|
49
|
-
padding: 0;
|
|
50
|
-
}
|
|
43
|
+
border-left: $-border-thickness solid var(--pkt-alert-bc);
|
|
44
|
+
background-color: var(--pkt-alert-bg);
|
|
45
|
+
color: var(--pkt-alert-txt);
|
|
51
46
|
|
|
52
47
|
&__title {
|
|
53
48
|
@include get-text('pkt-txt-18-medium');
|
|
54
|
-
|
|
55
|
-
align-items: center;
|
|
56
|
-
margin-bottom: $-alert-spacing;
|
|
49
|
+
margin: 0 0 $-alert-spacing 2.5rem;
|
|
57
50
|
}
|
|
58
51
|
|
|
59
|
-
&
|
|
60
|
-
|
|
61
|
-
align-items: flex-start;
|
|
52
|
+
&__close ~ &__title {
|
|
53
|
+
margin: 0 4rem $-alert-spacing 2.5rem;
|
|
62
54
|
}
|
|
63
55
|
|
|
64
|
-
&
|
|
65
|
-
@include get-text('pkt-txt-
|
|
66
|
-
margin
|
|
67
|
-
}
|
|
56
|
+
&__text {
|
|
57
|
+
@include get-text('pkt-txt-18-light');
|
|
58
|
+
margin: 0 0 0 2.5rem;
|
|
68
59
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
float: right;
|
|
72
|
-
margin-left: $-alert-spacing;
|
|
73
|
-
}
|
|
60
|
+
p {
|
|
61
|
+
margin-bottom: map.get(variables.$spacing, 'size-16');
|
|
74
62
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
flex-shrink: 0;
|
|
63
|
+
&:last-of-type {
|
|
64
|
+
margin-bottom: 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
80
67
|
}
|
|
81
68
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
&--success {
|
|
86
|
-
border-left: $-alert-success-border;
|
|
87
|
-
background-color: $-alert-success-bg;
|
|
88
|
-
color: $-alert-success-color;
|
|
69
|
+
&__close + &__text {
|
|
70
|
+
margin: 0 4rem 0 2.5rem;
|
|
71
|
+
}
|
|
89
72
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
&.pkt-alert .pkt-alert__close {
|
|
95
|
-
--fg-color: var(--color-green-dark);
|
|
96
|
-
}
|
|
73
|
+
&__title + &__text {
|
|
74
|
+
margin-left: 0;
|
|
75
|
+
margin-right: 0;
|
|
97
76
|
}
|
|
98
77
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
color: $-alert-error-color;
|
|
103
|
-
&.pkt-alert .pkt-alert__icon {
|
|
104
|
-
--bg-color: var(--color-error);
|
|
105
|
-
--fg-color: var(--color-red-5);
|
|
106
|
-
}
|
|
107
|
-
&.pkt-alert .pkt-alert__close {
|
|
108
|
-
--fg-color: var(--color-error);
|
|
109
|
-
}
|
|
78
|
+
&__date {
|
|
79
|
+
@include get-text('pkt-txt-14-light');
|
|
80
|
+
margin-top: $-alert-spacing;
|
|
110
81
|
}
|
|
111
82
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
&.pkt-alert .pkt-alert__close {
|
|
121
|
-
--fg-color: var(--color-warning);
|
|
122
|
-
}
|
|
83
|
+
&__icon {
|
|
84
|
+
--fg-color: var(--pkt-alert-icon-fg);
|
|
85
|
+
|
|
86
|
+
height: 2rem;
|
|
87
|
+
width: 2rem;
|
|
88
|
+
position: absolute;
|
|
89
|
+
top: 22px;
|
|
90
|
+
left: 20px;
|
|
123
91
|
}
|
|
124
92
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
--bg-color: var(--color-blue);
|
|
131
|
-
--fg-color: var(--color-blue-dark);
|
|
132
|
-
}
|
|
133
|
-
&.pkt-alert .pkt-alert__close {
|
|
134
|
-
--fg-color: var(--color-blue-dark);
|
|
135
|
-
}
|
|
93
|
+
&__close {
|
|
94
|
+
--fg-color: var(--pkt-alert-close-fg);
|
|
95
|
+
position: absolute;
|
|
96
|
+
right: 1.125rem;
|
|
97
|
+
top: 0.625rem;
|
|
136
98
|
}
|
|
137
99
|
}
|
|
@@ -27,57 +27,3 @@
|
|
|
27
27
|
width: 4rem;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
.pkt-font-icon {
|
|
32
|
-
display: inline-block;
|
|
33
|
-
font-size: map.get(variables.$font-size, 'large');
|
|
34
|
-
font-family: #{map.get(variables.$font-family, 'icon')};
|
|
35
|
-
|
|
36
|
-
&--chevron-left::before {
|
|
37
|
-
content: '\E907';
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&--chevron-right::before {
|
|
41
|
-
content: '\E908';
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&--chevron-up::before {
|
|
45
|
-
content: '\E909';
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&--chevron-down::before {
|
|
49
|
-
content: '\E906';
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&--user::before {
|
|
53
|
-
content: '\E921';
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&--menu::before {
|
|
57
|
-
content: '\E917';
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
&--close::before {
|
|
61
|
-
content: '\E923';
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
&--search::before {
|
|
65
|
-
content: '\E915';
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
&--trash::before {
|
|
69
|
-
content: '\E92D';
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
&--edit::before {
|
|
73
|
-
content: '\E949';
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&--filter::before {
|
|
77
|
-
content: '\E910';
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&--envelope::before {
|
|
81
|
-
content: '\E929';
|
|
82
|
-
}
|
|
83
|
-
}
|
|
@@ -17,27 +17,27 @@ $-module-name: 'pkt-btn';
|
|
|
17
17
|
$-sizes: (
|
|
18
18
|
'small': (
|
|
19
19
|
'text-class': 'pkt-txt-14-medium',
|
|
20
|
-
'padding': 0.5rem
|
|
21
|
-
'
|
|
22
|
-
'icon-m-icon-right': 0 0 0 0.5rem,
|
|
23
|
-
'icon-m-icon-only': 0 -0.3125rem,
|
|
20
|
+
'padding': 0 0.5rem,
|
|
21
|
+
'padding-icon-only': 0 0.5625rem,
|
|
24
22
|
'icon-size': 1.25rem,
|
|
23
|
+
'height': 2.625rem,
|
|
24
|
+
'line-height': 1.1,
|
|
25
25
|
),
|
|
26
26
|
'medium': (
|
|
27
27
|
'text-class': 'pkt-txt-18-medium',
|
|
28
|
-
'padding': 0
|
|
29
|
-
'
|
|
30
|
-
'icon-m-icon-right': 0.09375rem 0 0 0.5rem,
|
|
31
|
-
'icon-m-icon-only': 0.09375rem -0.21875rem,
|
|
28
|
+
'padding': 0 1rem,
|
|
29
|
+
'padding-icon-only': 0 0.625rem,
|
|
32
30
|
'icon-size': 1.5rem,
|
|
31
|
+
'height': 3rem,
|
|
32
|
+
'line-height': 1.1,
|
|
33
33
|
),
|
|
34
34
|
'large': (
|
|
35
35
|
'text-class': 'pkt-txt-24-medium',
|
|
36
|
-
'padding': 0
|
|
37
|
-
'
|
|
38
|
-
'icon-m-icon-right': 0.0625rem 0 0 0.5rem,
|
|
39
|
-
'icon-m-icon-only': 0.0625rem -0.25rem,
|
|
36
|
+
'padding': 0 1rem,
|
|
37
|
+
'padding-icon-only': 0 0.875rem,
|
|
40
38
|
'icon-size': 2rem,
|
|
39
|
+
'height': 4rem,
|
|
40
|
+
'line-height': 1.1,
|
|
41
41
|
),
|
|
42
42
|
);
|
|
43
43
|
$-skins: (
|
|
@@ -169,12 +169,14 @@ $-skins: (
|
|
|
169
169
|
@mixin -size($name, $o) {
|
|
170
170
|
@if $name == medium {
|
|
171
171
|
@include typography.get-text(map.get($o, 'text-class'));
|
|
172
|
+
height: map.get($o, 'height');
|
|
173
|
+
line-height: map.get($o, 'line-height');
|
|
172
174
|
padding: map.get($o, 'padding');
|
|
173
175
|
|
|
174
176
|
&__icon {
|
|
175
177
|
height: map.get($o, 'icon-size');
|
|
176
|
-
width: map.get($o, 'icon-size');
|
|
177
178
|
margin: map.get($o, 'icon-margin');
|
|
179
|
+
width: map.get($o, 'icon-size');
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
// button variants (base)
|
|
@@ -186,54 +188,35 @@ $-skins: (
|
|
|
186
188
|
|
|
187
189
|
&--icon-left {
|
|
188
190
|
flex-direction: row;
|
|
189
|
-
|
|
190
|
-
.#{$-module-name}__icon {
|
|
191
|
-
margin: map.get($o, 'icon-m-icon-left');
|
|
192
|
-
}
|
|
193
191
|
}
|
|
194
192
|
|
|
195
193
|
&--icon-right {
|
|
196
194
|
flex-direction: row-reverse;
|
|
197
|
-
|
|
198
|
-
.#{$-module-name}__icon {
|
|
199
|
-
margin: map.get($o, 'icon-m-icon-right');
|
|
200
|
-
}
|
|
201
195
|
}
|
|
202
196
|
&--icons-right-and-left {
|
|
203
197
|
flex-direction: row;
|
|
204
|
-
.#{$-module-name}__icon:first-of-type {
|
|
205
|
-
margin: map.get($o, 'icon-m-icon-left');
|
|
206
|
-
}
|
|
207
|
-
.#{$-module-name}__icon:last-of-type {
|
|
208
|
-
margin: map.get($o, 'icon-m-icon-right');
|
|
209
|
-
}
|
|
210
198
|
}
|
|
211
199
|
&--icon-only {
|
|
200
|
+
padding: map.get($o, 'padding-icon-only');
|
|
201
|
+
|
|
212
202
|
.#{$-module-name}__text {
|
|
213
203
|
@extend %sr-only;
|
|
214
204
|
}
|
|
215
|
-
.#{$-module-name}__icon {
|
|
216
|
-
margin: map.get($o, 'icon-m-icon-only');
|
|
217
|
-
}
|
|
218
205
|
}
|
|
219
206
|
} @else {
|
|
220
207
|
&--#{$name} {
|
|
221
208
|
@include typography.get-text(map.get($o, 'text-class'));
|
|
209
|
+
height: map.get($o, 'height');
|
|
210
|
+
line-height: map.get($o, 'line-height');
|
|
222
211
|
padding: map.get($o, 'padding');
|
|
223
212
|
}
|
|
224
213
|
&--#{$name} &__icon {
|
|
225
214
|
height: map.get($o, 'icon-size');
|
|
226
|
-
width: map.get($o, 'icon-size');
|
|
227
215
|
margin: map.get($o, 'icon-margin');
|
|
216
|
+
width: map.get($o, 'icon-size');
|
|
228
217
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
.#{$-module-name}--#{$name}.#{$-module-name}--icon-right &__icon {
|
|
233
|
-
margin: map.get($o, 'icon-m-icon-right');
|
|
234
|
-
}
|
|
235
|
-
.#{$-module-name}--#{$name}.#{$-module-name}--icon-only &__icon {
|
|
236
|
-
margin: map.get($o, 'icon-m-icon-only');
|
|
218
|
+
&--#{$name}.#{$-module-name}--icon-only {
|
|
219
|
+
padding: map.get($o, 'padding-icon-only');
|
|
237
220
|
}
|
|
238
221
|
}
|
|
239
222
|
}
|
|
@@ -273,7 +256,6 @@ $-skins: (
|
|
|
273
256
|
font-family: inherit;
|
|
274
257
|
font-weight: normal;
|
|
275
258
|
margin: 6px;
|
|
276
|
-
overflow: hidden;
|
|
277
259
|
position: relative;
|
|
278
260
|
-moz-user-select: none;
|
|
279
261
|
-webkit-user-select: none;
|
|
@@ -287,6 +269,8 @@ $-skins: (
|
|
|
287
269
|
text-decoration-thickness: 1px;
|
|
288
270
|
text-underline-offset: 0.3em;
|
|
289
271
|
text-align: left;
|
|
272
|
+
align-items: center;
|
|
273
|
+
column-gap: 0.5rem;
|
|
290
274
|
|
|
291
275
|
&[class*='pkt-btn--icon'] > .pkt-btn__icon {
|
|
292
276
|
display: block;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-css",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "CSS-rammeverket til Punkt, et designsystem laget av Oslo Origo",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo Origo",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"watch": "chokidar \"src/scss/**/*\" -c \"npm run build\""
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@oslokommune/punkt-assets": "^2.0.
|
|
24
|
+
"@oslokommune/punkt-assets": "^2.0.4",
|
|
25
25
|
"astro": "^2.0.2",
|
|
26
26
|
"chokidar-cli": "^3.0.0",
|
|
27
27
|
"edit-json-file": "^1.7.0",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
58
58
|
},
|
|
59
59
|
"license": "MIT",
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "035f27105ef83f6e175d996e4cd4e09d85fd9a7e"
|
|
61
61
|
}
|