@oslokommune/punkt-css 3.2.1 → 3.3.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.
@@ -16,8 +16,7 @@ $colors: (
16
16
  color-active-light: #b3f5ff,
17
17
  color-hover: #1f42aa,
18
18
  color-hover-light: #b3f5ff,
19
- color-visited: #8d50b1,
20
- color-visited-light: #e0adff,
19
+ color-focus: #e0adff,
21
20
  color-disabled: #4d4d4d,
22
21
  color-disabled-light: #f9f9f9,
23
22
  // system
@@ -30,16 +29,16 @@ $colors: (
30
29
  color-blue-dark-10: #d9e9f2,
31
30
  color-blue-5: #f1fdff,
32
31
  color-blue-10: #e5fcff,
33
- color-blue-60: #cdf5fb,
32
+ color-blue-60: #d1f9ff,
34
33
  color-green-dark-5: #f2fff3,
35
34
  color-green-dark-10: #d9f2ef,
36
35
  color-green-10: #e5ffe6,
37
- color-green-30: #c0f6e3,
36
+ color-green-30: #c7fde9,
38
37
  color-red-5: #fff3f2,
39
38
  color-red-10: #ffe8e5,
40
- color-red-30: #f9cfca,
39
+ color-red-30: #ffdfdc,
41
40
  color-yellow-5: #fef9f0,
42
- color-yellow-50: #fae1b6,
41
+ color-yellow-50: #ffe7bc,
43
42
  // grayscale digital
44
43
  color-gray-light: #f9f9f9,
45
44
  color-gray: #f2f2f2,
@@ -56,5 +55,4 @@ $colors: (
56
55
  color-grayscale-70: #4d4d4d,
57
56
  color-grayscale-80: #333,
58
57
  color-grayscale-90: #1a1a1a,
59
- color-black: #000
60
- ) !default;
58
+ color-black: #000) !default;
@@ -57,10 +57,11 @@ a {
57
57
  &:focus-visible,
58
58
  &.pkt-link--focus {
59
59
  box-shadow: 0px 0px 0px 0.125rem var(--color-active),
60
- 0px 0px 0px 0.375rem var(--color-visited-light);
60
+ 0px 0px 0px 0.375rem var(--color-focus);
61
61
  outline: none;
62
62
  color: var(--color-hover);
63
63
  }
64
+
64
65
  &:focus:not(:focus-visible) {
65
66
  box-shadow: none;
66
67
  outline: 0.125rem solid var(--color-active);
@@ -74,6 +75,7 @@ a {
74
75
  }
75
76
 
76
77
  @at-root [data-mode='dark'] a {
78
+
77
79
  // link
78
80
  &:link,
79
81
  &.pkt-link--link {
@@ -97,13 +99,14 @@ a {
97
99
  &:focus-visible,
98
100
  &.pkt-link--focus {
99
101
  box-shadow: 0px 0px 0px 0.125rem var(--color-active-light),
100
- 0px 0px 0px 0.375rem var(--color-visited-light);
102
+ 0px 0px 0px 0.375rem var(--color-focus);
101
103
  outline: none;
102
104
  color: var(--color-hover-light);
103
105
  }
106
+
104
107
  &:focus:not(:focus-visible) {
105
108
  box-shadow: none;
106
- outline: 0.125rem solid var(--color-visited-light);
109
+ outline: 0.125rem solid var(--color-focus);
107
110
  color: var(--color-hover-light);
108
111
  }
109
112
 
@@ -162,6 +165,7 @@ a {
162
165
  &--external::after {
163
166
  @include icon-new-window-small(white, null);
164
167
  }
168
+
165
169
  &--external:hover::after {
166
170
  @include icon-new-window-small(#b3f5ff, null);
167
171
  }
@@ -173,22 +177,27 @@ a {
173
177
  * prefix pkt
174
178
  */
175
179
 
176
- @each $name, $style in variables.$pkt-styles {
180
+ @each $name,
181
+ $style in variables.$pkt-styles {
177
182
  @include typography.generate-text-class($name, $style);
178
183
  }
179
184
 
180
- @each $name, $style in variables.$pkt-font-weight {
185
+ @each $name,
186
+ $style in variables.$pkt-font-weight {
181
187
  @include typography.generate-text-class($name, $style);
182
188
  }
189
+
183
190
  /*
184
191
  * Alignment
185
192
  */
186
193
  .pkt-txt-start {
187
194
  text-align: left !important;
188
195
  }
196
+
189
197
  .pkt-txt-end {
190
198
  text-align: right !important;
191
199
  }
200
+
192
201
  .pkt-txt-center {
193
202
  text-align: center !important;
194
203
  }
@@ -15,24 +15,21 @@
15
15
 
16
16
  $-module-name: 'pkt-btn';
17
17
  $-sizes: (
18
- 'small': (
19
- 'text-class': 'pkt-txt-14-medium',
18
+ 'small': ('text-class': 'pkt-txt-14-medium',
20
19
  'padding': 0 0.5rem,
21
20
  'padding-icon-only': 0 0.5625rem,
22
21
  'icon-size': 1.25rem,
23
22
  'height': 2.625rem,
24
23
  'line-height': 1.1,
25
24
  ),
26
- 'medium': (
27
- 'text-class': 'pkt-txt-18-medium',
25
+ 'medium': ('text-class': 'pkt-txt-18-medium',
28
26
  'padding': 0 1rem,
29
27
  'padding-icon-only': 0 0.625rem,
30
28
  'icon-size': 1.5rem,
31
29
  'height': 3rem,
32
30
  'line-height': 1.1,
33
31
  ),
34
- 'large': (
35
- 'text-class': 'pkt-txt-24-medium',
32
+ 'large': ('text-class': 'pkt-txt-24-medium',
36
33
  'padding': 0 1rem,
37
34
  'padding-icon-only': 0 0.875rem,
38
35
  'icon-size': 2rem,
@@ -41,15 +38,13 @@ $-sizes: (
41
38
  ),
42
39
  );
43
40
  $-skins: (
44
- 'primary': (
45
- 'light': (
46
- 'link-bg': --color-blue-dark,
41
+ 'primary': ('light': ('link-bg': --color-blue-dark,
47
42
  'link-bc': --color-blue-dark,
48
43
  'link-txt': --color-white,
49
44
  'focus-bg': --color-active,
50
45
  'focus-bc': --color-active,
51
46
  'focus-txt': --color-white,
52
- 'focus-outline': --color-visited-light,
47
+ 'focus-outline': --color-focus,
53
48
  'hover-bg': --color-active,
54
49
  'hover-bc': --color-active,
55
50
  'hover-txt': --color-white,
@@ -60,14 +55,13 @@ $-skins: (
60
55
  'disabled-bc': --color-gray,
61
56
  'disabled-txt': --color-disabled,
62
57
  ),
63
- 'dark': (
64
- 'link-bg': --color-blue-light,
58
+ 'dark': ('link-bg': --color-blue-light,
65
59
  'link-bc': --color-blue-light,
66
60
  'link-txt': --color-blue-dark,
67
61
  'focus-bg': --color-blue,
68
62
  'focus-bc': --color-blue,
69
63
  'focus-txt': --color-blue-dark,
70
- 'focus-outline': --color-visited-light,
64
+ 'focus-outline': --color-focus,
71
65
  'hover-bg': --color-blue,
72
66
  'hover-bc': --color-blue,
73
67
  'hover-txt': --color-blue-dark,
@@ -79,15 +73,13 @@ $-skins: (
79
73
  'disabled-txt': --color-disabled,
80
74
  ),
81
75
  ),
82
- 'secondary': (
83
- 'light': (
84
- 'link-bg': --color-transparent,
76
+ 'secondary': ('light': ('link-bg': --color-transparent,
85
77
  'link-bc': --color-blue-dark,
86
78
  'link-txt': --color-blue-dark,
87
79
  'focus-bg': --color-transparent,
88
80
  'focus-bc': --color-active,
89
81
  'focus-txt': --color-active,
90
- 'focus-outline': --color-visited-light,
82
+ 'focus-outline': --color-focus,
91
83
  'hover-bg': --color-active,
92
84
  'hover-bc': --color-active,
93
85
  'hover-txt': --color-white,
@@ -98,14 +90,13 @@ $-skins: (
98
90
  'disabled-bc': --color-gray,
99
91
  'disabled-txt': --color-disabled,
100
92
  ),
101
- 'dark': (
102
- 'link-bg': --color-transparent,
93
+ 'dark': ('link-bg': --color-transparent,
103
94
  'link-bc': --color-white,
104
95
  'link-txt': --color-white,
105
96
  'focus-bg': --color-transparent,
106
97
  'focus-bc': --color-active-light,
107
98
  'focus-txt': --color-active-light,
108
- 'focus-outline': --color-visited-light,
99
+ 'focus-outline': --color-focus,
109
100
  'hover-bg': --color-active-light,
110
101
  'hover-bc': --color-active-light,
111
102
  'hover-txt': --color-blue-dark,
@@ -117,9 +108,7 @@ $-skins: (
117
108
  'disabled-txt': --color-disabled,
118
109
  ),
119
110
  ),
120
- 'tertiary': (
121
- 'light': (
122
- 'link-bg': --color-transparent,
111
+ 'tertiary': ('light': ('link-bg': --color-transparent,
123
112
  'link-bc': --color-transparent,
124
113
  'link-txt': --color-blue-dark,
125
114
  'focus-bg': --color-gray,
@@ -135,14 +124,13 @@ $-skins: (
135
124
  'disabled-bc': --color-transparent,
136
125
  'disabled-txt': --color-disabled,
137
126
  ),
138
- 'dark': (
139
- 'link-bg': --color-transparent,
127
+ 'dark': ('link-bg': --color-transparent,
140
128
  'link-bc': --color-transparent,
141
129
  'link-txt': --color-white,
142
130
  'focus-bg': --color-blue-5,
143
131
  'focus-bc': --color-active,
144
132
  'focus-txt': --color-blue-dark,
145
- 'focus-outline': --color-visited-light,
133
+ 'focus-outline': --color-focus,
146
134
  'hover-bg': --color-blue-5,
147
135
  'hover-bc': --color-blue-5,
148
136
  'hover-txt': --color-blue-dark,
@@ -157,17 +145,19 @@ $-skins: (
157
145
  );
158
146
 
159
147
  @mixin -print-skin-as-css-vars($name, $o, $mode) {
160
- @each $key, $value in $o {
148
+
149
+ @each $key,
150
+ $value in $o {
151
+
161
152
  // Only print primary skin and css vars that differ from primary
162
- @if $name == 'primary' or $value != map.get($-skins, 'primary', $mode, $key)
163
- {
153
+ @if $name =='primary' or $value !=map.get($-skins, 'primary', $mode, $key) {
164
154
  --btn-#{$key}: var(#{$value});
165
155
  }
166
156
  }
167
157
  }
168
158
 
169
159
  @mixin -size($name, $o) {
170
- @if $name == medium {
160
+ @if $name ==medium {
171
161
  @include typography.get-text(map.get($o, 'text-class'));
172
162
  height: map.get($o, 'height');
173
163
  line-height: map.get($o, 'line-height');
@@ -193,9 +183,11 @@ $-skins: (
193
183
  &--icon-right {
194
184
  flex-direction: row-reverse;
195
185
  }
186
+
196
187
  &--icons-right-and-left {
197
188
  flex-direction: row;
198
189
  }
190
+
199
191
  &--icon-only {
200
192
  padding: map.get($o, 'padding-icon-only');
201
193
 
@@ -203,18 +195,22 @@ $-skins: (
203
195
  @extend %sr-only;
204
196
  }
205
197
  }
206
- } @else {
198
+ }
199
+
200
+ @else {
207
201
  &--#{$name} {
208
202
  @include typography.get-text(map.get($o, 'text-class'));
209
203
  height: map.get($o, 'height');
210
204
  line-height: map.get($o, 'line-height');
211
205
  padding: map.get($o, 'padding');
212
206
  }
207
+
213
208
  &--#{$name} &__icon {
214
209
  height: map.get($o, 'icon-size');
215
210
  margin: map.get($o, 'icon-margin');
216
211
  width: map.get($o, 'icon-size');
217
212
  }
213
+
218
214
  &--#{$name}.#{$-module-name}--icon-only {
219
215
  padding: map.get($o, 'padding-icon-only');
220
216
  }
@@ -223,20 +219,20 @@ $-skins: (
223
219
 
224
220
  @mixin -skin($name, $o) {
225
221
  $css-skin: '';
226
- @if $name != primary {
222
+
223
+ @if $name !=primary {
227
224
  $css-skin: --#{$name};
228
225
  }
229
226
 
230
227
  .#{$-module-name}#{$css-skin} {
231
- @include -print-skin-as-css-vars(
232
- $name,
228
+ @include -print-skin-as-css-vars($name,
233
229
  map.get($-skins, $name, 'light'),
234
230
  'light'
235
231
  );
236
232
  }
233
+
237
234
  @at-root [data-mode='dark'] .#{$-module-name}#{$css-skin} {
238
- @include -print-skin-as-css-vars(
239
- $name,
235
+ @include -print-skin-as-css-vars($name,
240
236
  map.get($-skins, $name, 'dark'),
241
237
  'dark'
242
238
  );
@@ -244,7 +240,8 @@ $-skins: (
244
240
  }
245
241
 
246
242
  // Print css vars for hvert skin
247
- @each $key, $value in $-skins {
243
+ @each $key,
244
+ $value in $-skins {
248
245
  @include -skin($key, map.get($value, 'light'));
249
246
  }
250
247
 
@@ -271,7 +268,7 @@ $-skins: (
271
268
  align-items: center;
272
269
  column-gap: 0.5rem;
273
270
 
274
- &[class*='pkt-btn--icon'] > .pkt-btn__icon {
271
+ &[class*='pkt-btn--icon']>.pkt-btn__icon {
275
272
  display: block;
276
273
  }
277
274
 
@@ -287,33 +284,36 @@ $-skins: (
287
284
  }
288
285
 
289
286
  @at-root a.#{$-module-name}:focus,
290
- &:enabled:focus,
291
- &.#{$-module-name}--focus {
287
+ &:enabled:focus,
288
+ &.#{$-module-name}--focus {
292
289
  background-color: var(--btn-focus-bg);
293
290
  color: var(--btn-focus-txt);
294
291
  border-color: var(--btn-focus-bc);
295
292
  outline: 4px solid var(--btn-focus-outline);
296
293
  text-decoration: none;
297
294
  }
295
+
298
296
  @at-root a.#{$-module-name}:hover,
299
- &:enabled:hover,
300
- &.#{$-module-name}--hover {
297
+ &:enabled:hover,
298
+ &.#{$-module-name}--hover {
301
299
  background-color: var(--btn-hover-bg);
302
300
  border-color: var(--btn-hover-bc);
303
301
  color: var(--btn-hover-txt);
304
302
  outline: 0;
305
303
  text-decoration: underline;
306
304
  }
305
+
307
306
  @at-root a.#{$-module-name}:active,
308
- &:enabled:active,
309
- &.#{$-module-name}--active,
310
- &.#{$-module-name}--active:hover {
307
+ &:enabled:active,
308
+ &.#{$-module-name}--active,
309
+ &.#{$-module-name}--active:hover {
311
310
  background-color: var(--btn-active-bg);
312
311
  border-color: var(--btn-active-bc);
313
312
  color: var(--btn-active-txt);
314
313
  outline: 0;
315
314
  text-decoration: none;
316
315
  }
316
+
317
317
  &:disabled {
318
318
  background-color: var(--btn-disabled-bg);
319
319
  border-color: var(--btn-disabled-bc);
@@ -322,7 +322,8 @@ $-skins: (
322
322
  }
323
323
 
324
324
  // button sizes & variants
325
- @each $key, $value in $-sizes {
325
+ @each $key,
326
+ $value in $-sizes {
326
327
  @include -size($key, $value);
327
328
  }
328
329
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-css",
3
- "version": "3.2.1",
3
+ "version": "3.3.1",
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",
@@ -17,13 +17,11 @@
17
17
  "build": "node ./scripts/build.js",
18
18
  "build-app": "node ./scripts/build-app.js && astro build",
19
19
  "dev": "astro dev",
20
- "preview": "astro preview",
21
- "watch": "chokidar \"src/scss/**/*\" -c \"npm run build\""
20
+ "preview": "astro preview"
22
21
  },
23
22
  "devDependencies": {
24
23
  "@oslokommune/punkt-assets": "^3.1.2",
25
24
  "astro": "^2.0.2",
26
- "chokidar-cli": "^3.0.0",
27
25
  "edit-json-file": "^1.7.0",
28
26
  "fs-extra": "^11.1.0",
29
27
  "prettier": "^2.8.3",
@@ -57,5 +55,5 @@
57
55
  "url": "https://github.com/oslokommune/punkt/issues"
58
56
  },
59
57
  "license": "MIT",
60
- "gitHead": "840aa8871f8ef5fb69a560e9a2b0e3117eb7536e"
58
+ "gitHead": "ea96fd86b38920748f5772c057b2c1449792b2e5"
61
59
  }