@oslokommune/punkt-css 5.2.1 → 6.0.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.
@@ -11,6 +11,8 @@ $spacing: (
11
11
  'size-48': 3rem,
12
12
  'size-56': 3.5rem,
13
13
  'size-64': 4rem,
14
+ 'size-72': 4.5rem,
15
+ 'size-88': 5.5rem,
14
16
  'size-104': 6.5rem,
15
17
  'size-128': 8rem,
16
18
  'size-5': 0.3125rem /* deprecated */,
@@ -32,7 +32,8 @@ strong {
32
32
  font-weight: map.get(variables.$font-weight, 'medium');
33
33
  }
34
34
 
35
- a {
35
+ a,
36
+ .pkt-link {
36
37
  // Order of pseudoclasses is important for specificity:
37
38
  // link, visited, hover, focus, active
38
39
  // but we don't use visited, so we can skip :link
@@ -142,7 +143,7 @@ a {
142
143
 
143
144
  &--external::after {
144
145
  content: ' ';
145
- --svg: url(https://punkt-cdn.oslo.kommune.no/5.2/icons/new-window-small.svg);
146
+ --svg: url(https://punkt-cdn.oslo.kommune.no/6.0/icons/new-window-small.svg);
146
147
  background-image: var(--svg);
147
148
  background-repeat: no-repeat;
148
149
  background-size: 18px 18px;
@@ -157,6 +158,15 @@ a {
157
158
  }
158
159
  }
159
160
 
161
+ button.pkt-link {
162
+ background: none;
163
+ border: none;
164
+ padding: 0;
165
+ font-family: inherit;
166
+ cursor: pointer;
167
+ font-weight: inherit;
168
+ }
169
+
160
170
  @at-root [data-mode='dark'] {
161
171
  .pkt-link {
162
172
  &--external::after {
@@ -6,120 +6,279 @@
6
6
  @use '../abstracts/variables';
7
7
  @use '../abstracts/mixins/' as *;
8
8
 
9
- $-header-height: 56px;
10
- $-header-height-phablet-up: 60px;
11
- $-logo-width: calc($-header-height * 60 / 31);
12
- $-logo-width-phablet-up: calc($-header-height-phablet-up * 60 / 31);
13
-
14
9
  .pkt-header {
15
10
  background-color: var(--color-white);
16
11
  border-bottom: 1px solid var(--color-gray);
17
- display: grid;
18
- gap: 0 0;
19
- grid-template-areas: 'header-logo header-actions';
20
- grid-template-columns: minmax($-logo-width, $-logo-width-phablet-up) 1fr;
21
- padding: map.get(variables.$spacing, 'size-16')
22
- map.get(variables.$spacing, 'size-16');
12
+ display: flex;
13
+ justify-content: space-between;
23
14
  align-items: center;
15
+ padding: 0 map.get(variables.$spacing, 'size-16');
16
+ height: map.get(variables.$spacing, 'size-72');
17
+
18
+ @include bp('tablet-up') {
19
+ height: map.get(variables.$spacing, 'size-88');
20
+ }
24
21
 
25
22
  @include bp('laptop-up') {
26
- padding: map.get(variables.$spacing, 'size-24')
27
- map.get(variables.$spacing, 'size-40');
23
+ height: map.get(variables.$spacing, 'size-104');
24
+ padding: 0 map.get(variables.$spacing, 'size-48');
25
+ }
26
+
27
+ &--fixed {
28
+ width: 100vw;
29
+ position: fixed;
30
+ top: 0;
31
+ left: 0;
32
+ z-index: 10;
33
+ }
34
+
35
+ &--scroll-to-hide {
36
+ transform: translate3d(0, 0, 0);
37
+ transition: 0.5s transform ease-in-out;
38
+ }
39
+
40
+ &--hidden {
41
+ transform: translate3d(0, -100%, 0);
28
42
  }
29
43
 
30
44
  &__logo {
31
- grid-area: header-logo;
45
+ flex: 0 1 auto;
46
+ display: flex;
47
+ align-items: center;
48
+ gap: map.get(variables.$spacing, 'size-16');
49
+ margin: 0;
50
+ padding: 0;
32
51
 
33
- &-link {
34
- display: block;
52
+ @include bp('laptop-up') {
53
+ gap: map.get(variables.$spacing, 'size-24');
54
+ }
55
+
56
+ &-link,
57
+ &-service {
58
+ display: inline-block;
59
+ margin: 0;
60
+ padding: 0;
61
+ }
62
+
63
+ &-service {
64
+ padding-top: 0.28rem;
65
+ display: none;
66
+ white-space: nowrap;
67
+ text-overflow: ellipsis;
68
+ overflow: hidden;
69
+
70
+ @include get-text('pkt-txt-22-light');
71
+
72
+ @include bp('tablet-up') {
73
+ display: inline-block;
74
+ }
75
+
76
+ @include bp('laptop-up') {
77
+ padding-top: 0.45rem;
78
+ @include get-text('pkt-txt-24-light');
79
+ }
35
80
  }
36
81
 
37
82
  &-svg {
38
- height: $-header-height;
39
- width: calc($-header-height * 60 / 31);
83
+ height: map.get(variables.$spacing, 'size-56');
84
+ width: calc(map.get(variables.$spacing, 'size-56') * 60 / 31);
40
85
 
41
- @include bp('phablet-up') {
42
- height: $-header-height-phablet-up;
43
- width: calc($-header-height-phablet-up * 60 / 31);
86
+ @include bp('laptop-up') {
87
+ height: map.get(variables.$spacing, 'size-64');
88
+ width: calc(map.get(variables.$spacing, 'size-64') * 60 / 31);
44
89
  }
45
90
  }
46
91
  }
92
+
93
+ &--narrow {
94
+ padding: 0 map.get(variables.$spacing, 'size-16');
95
+ height: map.get(variables.$spacing, 'size-72');
96
+
97
+ .pkt-header__logo {
98
+ gap: map.get(variables.$spacing, 'size-16');
99
+
100
+ &-service {
101
+ padding-top: 0.28rem;
102
+ @include get-text('pkt-txt-18-light');
103
+ }
104
+
105
+ &-svg {
106
+ height: map.get(variables.$spacing, 'size-48');
107
+ width: calc(map.get(variables.$spacing, 'size-48') * 60 / 31);
108
+ }
109
+ }
110
+ }
111
+
112
+ &__menu-btn {
113
+ @media screen and (min-width: 0) and (max-width: map.get(variables.$breakpoints, 'tablet-big')) {
114
+ border: 0;
115
+
116
+ .pkt-btn__text {
117
+ display: none;
118
+ }
119
+ }
120
+ }
121
+
122
+ &__user-btn {
123
+ border-color: var(--color-yellow);
124
+ }
125
+
47
126
  &__actions {
48
- grid-area: header-actions;
127
+ flex: 1 0 auto;
49
128
  display: flex;
50
129
  justify-content: flex-end;
51
- align-items: center;
130
+ align-items: stretch;
131
+
132
+ &-row {
133
+ list-style: none;
134
+ padding-left: 0;
135
+ margin: 0;
136
+ display: flex;
137
+ align-items: center;
138
+ gap: map.get(variables.$spacing, 'size-32');
139
+
140
+ > li {
141
+ padding: 0;
142
+ }
143
+ }
52
144
  }
53
145
 
54
- &__action {
55
- align-items: center;
56
- display: inline-flex;
57
- flex-direction: row;
58
- margin: 0 0 0 map.get(variables.$spacing, 'size-16');
146
+ &__dropdown {
147
+ z-index: 2;
148
+ position: absolute;
149
+ margin: 0;
150
+ margin-top: map.get(variables.$spacing, 'size-12');
151
+ right: 0;
152
+ left: 0;
153
+ padding-left: 0;
154
+ list-style: none;
155
+ visibility: hidden;
156
+ max-height: calc(100vh - 4.5rem);
157
+ overflow-x: hidden;
158
+ overflow-y: auto;
59
159
 
60
- @include bp('phablet-up') {
61
- height: $-header-height-phablet-up;
62
- margin: 0 0 0 map.get(variables.$spacing, 'size-32');
160
+ @include bp('tablet-up') {
161
+ margin-top: map.get(variables.$spacing, 'size-16');
162
+ left: auto;
163
+ right: 0;
164
+ min-width: 23rem;
165
+ width: auto;
63
166
  }
64
167
 
65
- &-text {
66
- @include get-text('pkt-txt-18-light');
67
- display: inline-flex;
68
- align-items: center;
69
- max-width: 3.125rem;
70
- white-space: nowrap;
168
+ > li {
169
+ padding: map.get(variables.$spacing, 'size-32');
170
+ background-color: var(--color-white);
71
171
 
72
- @include bp('phablet-up') {
73
- max-width: none;
172
+ &.footer {
173
+ padding-top: map.get(variables.$spacing, 'size-16');
174
+ padding-bottom: map.get(variables.$spacing, 'size-16');
74
175
  }
75
- }
76
- &-textrow {
77
- display: inline-flex;
78
- @include get-text('pkt-txt-18-light');
79
- max-width: 3.125rem;
80
176
 
81
- @include bp('phablet-up') {
82
- max-width: none;
177
+ &:nth-child(odd) {
178
+ background-color: var(--color-gray-light);
83
179
  }
84
- &.text-row-inline {
85
- display: inline;
180
+ }
181
+ }
182
+
183
+ &__user-fullname {
184
+ display: none;
185
+
186
+ @include bp('laptop-up') {
187
+ display: inline;
188
+ }
189
+ }
190
+
191
+ &__user-shortname {
192
+ display: inline;
193
+
194
+ @include bp('laptop-up') {
195
+ display: none;
196
+ }
197
+ }
198
+
199
+ &--has-dropdown {
200
+ @include bp('tablet-up') {
201
+ position: relative;
202
+ }
203
+
204
+ > .pkt-btn {
205
+ &:hover .pkt-btn--closed {
206
+ --fg-color: var(--color-white);
86
207
  }
87
208
  }
88
- &-change {
89
- margin-left: map.get(variables.$spacing, 'size-12');
209
+
210
+ .pkt-btn--open {
211
+ display: none;
90
212
  }
91
213
 
92
- &-icon {
93
- --fg-color: var(--color-blue-dark);
94
- height: 1.5rem;
95
- line-height: 1rem;
96
- width: 1.5rem;
97
- margin-left: map.get(variables.$spacing, 'size-4');
214
+ .pkt-btn--closed {
215
+ display: none;
98
216
 
99
- @include bp('tablet-up') {
100
- height: 1.5rem;
101
- margin-left: 0.5rem;
102
- width: 1.5rem;
217
+ @include bp('laptop-up') {
218
+ display: inline-block;
103
219
  }
104
220
  }
221
+
222
+ &.pkt-header--open-dropdown {
223
+ > .pkt-btn {
224
+ background-color: var(--color-active);
225
+ border-color: var(--color-active);
226
+ color: var(--color-white);
227
+
228
+ .pkt-btn--open {
229
+ --fg-color: var(--color-white);
230
+ @include bp('laptop-up') {
231
+ display: inline-block;
232
+ }
233
+ }
234
+
235
+ .pkt-btn--closed {
236
+ display: none;
237
+ }
238
+ }
239
+
240
+ .pkt-header__dropdown {
241
+ visibility: visible;
242
+ }
243
+ }
244
+ }
245
+ }
246
+
247
+ .pkt-user-menu {
248
+ p {
249
+ margin: 0;
250
+ }
251
+ &__label {
252
+ color: var(--color-grayscale-60);
253
+ @include get-text('pkt-txt-14-medium');
105
254
  }
106
255
 
107
- & .pkt-btn {
256
+ &__name {
108
257
  @include get-text('pkt-txt-18-medium');
109
- margin: 0 0 0 map.get(variables.$spacing, 'size-4');
110
- padding: map.get(variables.$spacing, 'size-12')
111
- map.get(variables.$spacing, 'size-12');
258
+ }
112
259
 
113
- @include bp('tablet-up') {
114
- margin: 0 0 0 map.get(variables.$spacing, 'size-32');
115
- padding: map.get(variables.$spacing, 'size-12')
116
- map.get(variables.$spacing, 'size-16');
117
- }
118
- &:hover .pkt-header__action-icon {
119
- --fg-color: var(--color-hover);
260
+ &__last-logged-in,
261
+ &__org_number {
262
+ @include get-text('pkt-txt-16-light');
263
+ }
264
+
265
+ .pkt-list {
266
+ margin: 0;
267
+ .pkt-link {
268
+ text-decoration: none;
269
+
270
+ &:hover {
271
+ text-decoration: underline;
272
+ }
120
273
  }
121
- &__text--representing {
122
- @include get-text('pkt-txt-18-light');
274
+
275
+ > li > a {
276
+ grid-template-columns: 1.5rem auto;
277
+ gap: map.get(variables.$spacing, 'size-8');
123
278
  }
124
279
  }
280
+
281
+ .pkt-list-horizontal {
282
+ margin: 0;
283
+ }
125
284
  }
@@ -81,7 +81,7 @@ $-module-name: 'pkt-form-check-input';
81
81
  }
82
82
 
83
83
  &[type='checkbox'] {
84
- --svg: url(https://punkt-cdn.oslo.kommune.no/5.2/icons/check-medium.svg);
84
+ --svg: url(https://punkt-cdn.oslo.kommune.no/6.0/icons/check-medium.svg);
85
85
  position: relative;
86
86
  background-color: blue;
87
87
  }
@@ -38,6 +38,26 @@
38
38
  }
39
39
  }
40
40
 
41
+ .pkt-list-horizontal {
42
+ display: flex;
43
+ list-style: none;
44
+ padding: 0;
45
+ li {
46
+ padding-right: map.get(variables.$spacing, 'size-16');
47
+ }
48
+ li + li {
49
+ padding-left: map.get(variables.$spacing, 'size-16');
50
+ }
51
+ li:last-child {
52
+ padding-right: 0;
53
+ }
54
+ &.bordered {
55
+ li + li {
56
+ border-left: 1px solid var(--color-grayscale-60);
57
+ }
58
+ }
59
+ }
60
+
41
61
  // ==========================================================================
42
62
  // Definition lists
43
63
  // ==========================================================================
@@ -10,7 +10,7 @@
10
10
  @use '../abstracts/functions';
11
11
 
12
12
  .pkt-select {
13
- --svg: url(https://punkt-cdn.oslo.kommune.no/5.2/icons/chevron-thin-down.svg);
13
+ --svg: url(https://punkt-cdn.oslo.kommune.no/6.0/icons/chevron-thin-down.svg);
14
14
 
15
15
  display: block;
16
16
  background-color: var(--color-white);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-css",
3
- "version": "5.2.1",
3
+ "version": "6.0.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",
@@ -20,7 +20,7 @@
20
20
  "preview": "astro preview"
21
21
  },
22
22
  "devDependencies": {
23
- "@oslokommune/punkt-assets": "^5.1.19",
23
+ "@oslokommune/punkt-assets": "^6.0.0",
24
24
  "astro": "^2.8.1",
25
25
  "edit-json-file": "^1.7.0",
26
26
  "fs-extra": "^11.1.0",
@@ -55,5 +55,5 @@
55
55
  "url": "https://github.com/oslokommune/punkt/issues"
56
56
  },
57
57
  "license": "MIT",
58
- "gitHead": "582b1bb38c470e76cbdb5e0ec2dc98231f674291"
58
+ "gitHead": "10efdb492b7e84d8339e19a74358c02b940a6bb7"
59
59
  }