@oslokommune/punkt-css 4.3.2 → 5.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.
@@ -75,7 +75,6 @@ a {
75
75
  }
76
76
 
77
77
  @at-root [data-mode='dark'] a {
78
-
79
78
  // link
80
79
  &:link,
81
80
  &.pkt-link--link {
@@ -118,12 +117,6 @@ a {
118
117
  }
119
118
  }
120
119
 
121
- @mixin icon-new-window-small($fg-color: #2a2859, $bg-color: null) {
122
- $svg: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="new-window-small" fill="none" data-category="ui" viewBox="0 0 32 32"><g fill="#{$fg-color}"><path d="M23.03 21.11v2.06H8.97V9.18h2.06v-2H8.97v-.01h-2v18h18.06v-4.06h-2Z"/><path d="M18 7.16v2h3.62l-7.26 7.28 1.38 1.39 7.27-7.29v3.63h2.02V7.16H18Z"/></g></svg>');
123
- background-image: functions.escape-svg($svg);
124
- background-repeat: no-repeat;
125
- }
126
-
127
120
  .pkt-link {
128
121
  display: inline-flex;
129
122
  text-align: left;
@@ -149,25 +142,32 @@ a {
149
142
 
150
143
  &--external::after {
151
144
  content: ' ';
152
- @include icon-new-window-small(#2a2859, null);
145
+ --svg: url(https://punkt-cdn.oslo.kommune.no/5.0/icons/new-window-small.svg);
146
+ background-image: var(--svg);
147
+ background-repeat: no-repeat;
153
148
  background-size: 18px 18px;
154
149
  width: 1.125rem;
155
150
  height: 1.125rem;
156
151
  }
157
152
 
158
153
  &--external:hover::after {
159
- @include icon-new-window-small(#1f42aa, null);
154
+ // #1f42aa
155
+ filter: brightness(0) saturate(100%) invert(16%) sepia(99%) saturate(2420%)
156
+ hue-rotate(222deg) brightness(93%) contrast(90%);
160
157
  }
161
158
  }
162
159
 
163
160
  @at-root [data-mode='dark'] {
164
161
  .pkt-link {
165
162
  &--external::after {
166
- @include icon-new-window-small(white, null);
163
+ // white
164
+ filter: brightness(0) saturate(100%) invert(100%);
167
165
  }
168
166
 
169
167
  &--external:hover::after {
170
- @include icon-new-window-small(#b3f5ff, null);
168
+ // #b3f5ff
169
+ filter: brightness(0) saturate(100%) invert(80%) sepia(54%) saturate(502%)
170
+ hue-rotate(173deg) brightness(109%) contrast(105%);
171
171
  }
172
172
  }
173
173
  }
@@ -177,13 +177,11 @@ a {
177
177
  * prefix pkt
178
178
  */
179
179
 
180
- @each $name,
181
- $style in variables.$pkt-styles {
180
+ @each $name, $style in variables.$pkt-styles {
182
181
  @include typography.generate-text-class($name, $style);
183
182
  }
184
183
 
185
- @each $name,
186
- $style in variables.$pkt-font-weight {
184
+ @each $name, $style in variables.$pkt-font-weight {
187
185
  @include typography.generate-text-class($name, $style);
188
186
  }
189
187
 
@@ -18,6 +18,10 @@
18
18
  map.get(variables.$spacing, 'size-64');
19
19
  }
20
20
 
21
+ &__list {
22
+ list-style-type: none;
23
+ }
24
+
21
25
  &__link {
22
26
  display: flex;
23
27
  align-items: center;
@@ -41,7 +45,6 @@
41
45
  &__icon {
42
46
  flex-basis: 1rem;
43
47
  flex-shrink: 0;
44
- padding-bottom: 4px;
45
48
  }
46
49
 
47
50
  &__text {
@@ -123,8 +123,4 @@
123
123
  height: 1rem;
124
124
  margin-right: map.get(variables.$spacing, 'size-12');
125
125
  }
126
-
127
- &__icon-svg {
128
- vertical-align: top;
129
- }
130
126
  }
@@ -15,14 +15,16 @@ $-footer-link-b-margin: map.get(variables.$spacing, 'size-16');
15
15
 
16
16
  .pkt-footer {
17
17
  @include typography.get-text('pkt-txt-18-light');
18
- padding: map.get(variables.$spacing, 'size-40') map.get(variables.$spacing, 'size-24');
18
+ padding: map.get(variables.$spacing, 'size-40')
19
+ map.get(variables.$spacing, 'size-24');
19
20
  background-color: $-footer-bg-color;
20
21
  color: $-footer-color;
21
22
  display: flex;
22
23
  align-items: center;
23
24
 
24
25
  @include bp('laptop-up') {
25
- padding: map.get(variables.$spacing, 'size-56') map.get(variables.$spacing, 'size-24');
26
+ padding: map.get(variables.$spacing, 'size-56')
27
+ map.get(variables.$spacing, 'size-24');
26
28
  justify-content: center;
27
29
  }
28
30
 
@@ -66,7 +68,6 @@ $-footer-link-b-margin: map.get(variables.$spacing, 'size-16');
66
68
  }
67
69
  }
68
70
 
69
-
70
71
  &__link {
71
72
  display: flex;
72
73
  text-decoration: none !important;
@@ -114,7 +115,6 @@ $-footer-link-b-margin: map.get(variables.$spacing, 'size-16');
114
115
 
115
116
  &-icon {
116
117
  --fg-color: currentColor;
117
- flex-shrink: 0;
118
118
  width: 24px;
119
119
  height: 24px;
120
120
  }
@@ -129,7 +129,8 @@ $-footer-link-b-margin: map.get(variables.$spacing, 'size-16');
129
129
 
130
130
  .pkt-footer-simple {
131
131
  @include typography.get-text('pkt-txt-18-light');
132
- padding: map.get(variables.$spacing, 'size-32') map.get(variables.$spacing, 'size-24');
132
+ padding: map.get(variables.$spacing, 'size-32')
133
+ map.get(variables.$spacing, 'size-24');
133
134
  background-color: $-footer-bg-color;
134
135
  color: $-footer-color;
135
136
  display: flex;
@@ -9,20 +9,20 @@
9
9
 
10
10
  .pkt-icon {
11
11
  display: inline-flex;
12
- height: 2rem;
13
- width: 2rem;
12
+ min-height: 1rem;
13
+ min-width: 1rem;
14
14
 
15
- &.small {
15
+ &--small {
16
16
  height: 1rem;
17
17
  width: 1rem;
18
18
  }
19
19
 
20
- &.medium {
20
+ &--medium {
21
21
  height: 1.5rem;
22
22
  width: 1.5rem;
23
23
  }
24
24
 
25
- &.large {
25
+ &--large {
26
26
  height: 4rem;
27
27
  width: 4rem;
28
28
  }
@@ -29,18 +29,21 @@ $-linkcard-spacing-big: map.get(variables.$spacing, 'size-24');
29
29
  text-decoration: underline;
30
30
  }
31
31
 
32
-
33
32
  &:hover .pkt-link--external {
34
33
  &::after {
35
- filter: brightness(0) saturate(100%) invert(16%) sepia(99%) saturate(2420%) hue-rotate(222deg) brightness(93%) contrast(90%);
34
+ filter: brightness(0) saturate(100%) invert(16%) sepia(99%)
35
+ saturate(2420%) hue-rotate(222deg) brightness(93%) contrast(90%);
36
36
  }
37
37
  }
38
38
 
39
-
40
39
  &__title {
41
40
  @include get-text('pkt-txt-24-medium');
42
41
  margin-bottom: 0.5rem;
43
42
 
43
+ & > p {
44
+ margin: 0;
45
+ }
46
+
44
47
  &.pkt-link--external::after {
45
48
  height: 1.5rem;
46
49
  width: 1.5rem;
@@ -49,6 +52,12 @@ $-linkcard-spacing-big: map.get(variables.$spacing, 'size-24');
49
52
  }
50
53
  }
51
54
 
55
+ &.pkt-link {
56
+ .pkt-icon.pkt-link__icon {
57
+ margin-top: 0.375rem;
58
+ }
59
+ }
60
+
52
61
  &__text {
53
62
  p:first-of-type {
54
63
  margin-top: 0;
@@ -59,10 +68,6 @@ $-linkcard-spacing-big: map.get(variables.$spacing, 'size-24');
59
68
  }
60
69
  }
61
70
 
62
- & svg {
63
- margin-top: 0.313rem;
64
- }
65
-
66
71
  // Modifiers
67
72
  &--beige {
68
73
  background-color: var(--color-beige-light);
@@ -0,0 +1,130 @@
1
+ /*
2
+ * Choices - checkbox and radio
3
+ * https://css-tricks.com/html-inputs-and-labels-a-love-story/
4
+ *
5
+ * TODO: Dette er ikke ferdigstilt, og må refaktoreres ved anledning.
6
+ * Mangler gjennomgang av farger, focus-state og ikke minst et
7
+ * element som wrapper for label og input.
8
+ *
9
+ */
10
+
11
+ @use 'sass:map';
12
+ @use '../abstracts/variables';
13
+ @use '../abstracts/functions';
14
+
15
+ $-module-name: 'pkt-form-check-input';
16
+
17
+ .#{$-module-name} {
18
+ // Choice as a group name for checkbox and radio
19
+ --choice-norm-bg: var(--color-white);
20
+ --choice-norm-bc: var(--color-blue-dark);
21
+ --choice-hover-bg: var(--color-white);
22
+ --choice-hover-bc: var(--color-active);
23
+ --choice-focus-bg: var(--color-white);
24
+ --choice-focus-bc: var(--color-active);
25
+ --choice-focus-ol: var(--color-focus);
26
+ --choice-active-bg: var(--color-active);
27
+ --choice-active-bc: var(--color-active);
28
+ --choice-active-ol: var(--color-active);
29
+ --choice-checked-rb-bg: var(--color-white);
30
+ --choice-checked-rb-bc: var(--color-active);
31
+ --choice-checked-cb-bg: var(--color-active);
32
+ --choice-checked-cb-bc: var(--color-active);
33
+ --choice-disabled-bg: var(--color-white);
34
+ --choice-disabled-bc: var(--color-grayscale-30);
35
+ --choice-disabled-txt: var(--color-grayscale-30);
36
+ --choice-disabled-checked-bg: var(--color-grayscale-30);
37
+ --choice-disabled-checked-bc: var(--color-grayscale-30);
38
+
39
+ appearance: none;
40
+ background-color: var(--choice-norm-bg);
41
+ background-repeat: no-repeat;
42
+ background-position: center;
43
+ background-size: contain;
44
+ border: 2px solid var(--choice-norm-bc);
45
+ display: inline-block;
46
+ margin: 0.125rem 0.25rem 0 0;
47
+ width: 1.25rem;
48
+ height: 1.25rem;
49
+ transition: all 0.3s ease-out;
50
+ vertical-align: top;
51
+
52
+ &[type='checkbox'] {
53
+ border-radius: 0;
54
+ }
55
+
56
+ &[type='radio'] {
57
+ border-radius: 50%;
58
+ }
59
+
60
+ &:hover {
61
+ background-color: var(--choice-hover-bg);
62
+ border-color: var(--choice-hover-bc);
63
+ }
64
+
65
+ &:focus {
66
+ background-color: var(--choice-focus-bg);
67
+ border-color: var(--choice-focus-bc);
68
+ outline: 2px solid var(--choice-focus-ol);
69
+ }
70
+
71
+ &:active {
72
+ background-color: var(--choice-active-bg);
73
+ border-color: var(--choice-active-bc);
74
+ outline: 6px solid var(--choice-active-ol);
75
+ }
76
+
77
+ &:checked {
78
+ &[type='radio'] {
79
+ background-color: var(--choice-checked-rb-bg);
80
+ border: 6px solid var(--choice-checked-rb-bc);
81
+ }
82
+ &[type='checkbox'] {
83
+ --svg: url(https://punkt-cdn.oslo.kommune.no/5.0/components/checkbox.svg);
84
+ background-color: var(--choice-checked-cb-bg);
85
+ border-color: var(--choice-checked-cb-bc);
86
+ -webkit-mask-image: var(--svg);
87
+ mask-image: var(--svg);
88
+ }
89
+ }
90
+
91
+ // Disabled styles
92
+ &:disabled {
93
+ background-color: var(--choice-disabled-bg);
94
+ border-color: var(--choice-disabled-bc);
95
+ cursor: not-allowed;
96
+ }
97
+ &:disabled:checked {
98
+ &[type='checkbox'] {
99
+ background-color: var(--choice-disabled-checked-bg);
100
+ border-color: var(--choice-disabled-checked-bc);
101
+ }
102
+ }
103
+
104
+ &:disabled ~ .pkt-form-label {
105
+ color: var(--choice-disabled-txt);
106
+ cursor: not-allowed;
107
+ }
108
+ }
109
+
110
+ [data-mode='dark'] .#{$-module-name} {
111
+ --choice-norm-bg: var(--color-blue-dark);
112
+ --choice-norm-bc: var(--color-blue-light);
113
+ --choice-hover-bg: var(--color-white);
114
+ --choice-hover-bc: var(--color-active-light);
115
+ --choice-focus-bg: var(--color-white);
116
+ --choice-focus-bc: var(--color-active-light);
117
+ --choice-focus-ol: var(--color-hover);
118
+ --choice-active-bg: var(--color-active-light);
119
+ --choice-active-bc: var(--color-active-light);
120
+ --choice-active-ol: var(--color-active-light);
121
+ --choice-checked-rb-bg: var(--color-white);
122
+ --choice-checked-rb-bc: var(--color-active-light);
123
+ --choice-checked-cb-bg: var(--color-active-light);
124
+ --choice-checked-cb-bc: var(--color-active-light);
125
+ --choice-disabled-bg: var(--color-gray-dark);
126
+ --choice-disabled-bc: var(--color-grayscale-30);
127
+ --choice-disabled-txt: var(--color-disabled);
128
+ --choice-disabled-checked-bg: var(--color-grayscale-30);
129
+ --choice-disabled-checked-bc: var(--color-grayscale-30);
130
+ }
@@ -8,8 +8,6 @@
8
8
  @use '../abstracts/variables';
9
9
  @use '../abstracts/functions';
10
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
11
  /* TODO: move to animation.scss */
14
12
  @keyframes enter {
15
13
  from {
@@ -126,64 +124,4 @@ $-checkbox-img: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'
126
124
  // TODO
127
125
  }
128
126
  }
129
-
130
- &-check-input {
131
- appearance: none;
132
- background-color: var(--color-white);
133
- background-repeat: no-repeat;
134
- background-position: center;
135
- background-size: contain;
136
- border: 2px solid var(--color-blue-dark);
137
- display: inline-block;
138
- margin: 0.125rem 0.25rem 0 0;
139
- width: 1.25rem;
140
- height: 1.25rem;
141
- transition: all 0.3s ease-out;
142
- vertical-align: top;
143
-
144
- &[type='checkbox'] {
145
- border-radius: 0;
146
- }
147
-
148
- &[type='radio'] {
149
- border-radius: 50%;
150
- }
151
-
152
- &:hover {
153
- border-color: var(--color-active);
154
- }
155
-
156
- &:active {
157
- border-color: var(--color-active);
158
- outline: 2px solid var(--color-active);
159
- }
160
-
161
- &:focus {
162
- border-color: var(--color-active);
163
- outline: 2px solid var(--color-hover);
164
- }
165
-
166
- &:checked {
167
- &[type='radio'] {
168
- background-color: var(--color-white);
169
- border: 6px solid var(--color-active);
170
- }
171
- &[type='checkbox'] {
172
- background-color: var(--color-active);
173
- background-image: functions.escape-svg($-checkbox-img);
174
- border-color: var(--color-active);
175
- }
176
- }
177
-
178
- // Disabled styles
179
- &:disabled {
180
- border-color: var(--color-grayscale-30);
181
- cursor: not-allowed;
182
- }
183
-
184
- &:disabled ~ .pkt-form-label {
185
- color: var(--color-grayscale-30);
186
- cursor: not-allowed;
187
- }
188
- }
189
127
  }
@@ -1,8 +1,9 @@
1
- @forward "button";
2
- @forward "form";
3
- @forward "hr";
4
- @forward "image";
5
- @forward "list";
6
- @forward "section";
7
- @forward "select";
8
- @forward "table";
1
+ @forward 'button';
2
+ @forward 'form';
3
+ @forward 'checkbox-radio';
4
+ @forward 'hr';
5
+ @forward 'image';
6
+ @forward 'list';
7
+ @forward 'section';
8
+ @forward 'select';
9
+ @forward 'table';
@@ -9,20 +9,12 @@
9
9
  @use '../abstracts/variables';
10
10
  @use '../abstracts/functions';
11
11
 
12
- @mixin -icon-arrow($status: enabled) {
13
- $svg-color: #2a2859;
14
- @if $status != enabled {
15
- $svg-color: #b9b9b9;
16
- }
17
-
18
- $arrow: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path d='M16 19.41L6.33 10 5 11.29 16 22l11-10.71L25.67 10 16 19.41z' fill-rule='evenodd' fill='#{$svg-color}' /></svg>") !default;
19
- background-image: functions.escape-svg($arrow);
20
- }
21
-
22
12
  .pkt-select {
13
+ --svg: url(https://punkt-cdn.oslo.kommune.no/5.0/icons/chevron-thin-down.svg);
14
+
23
15
  display: block;
24
16
  background-color: var(--color-white);
25
- @include -icon-arrow('enabled');
17
+ background-image: var(--svg);
26
18
  background-repeat: no-repeat;
27
19
  background-position: right 0.7rem top 50%;
28
20
  background-size: 2rem auto, 100%;
@@ -69,9 +61,8 @@
69
61
  }
70
62
 
71
63
  &:disabled {
72
- @include -icon-arrow('disabled');
73
- border-color: var(--color-grayscale-30);
74
- color: var(--color-grayscale-30);
64
+ filter: grayscale(1) brightness(4.16);
65
+ font-weight: 500;
75
66
  }
76
67
 
77
68
  option {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-css",
3
- "version": "4.3.2",
3
+ "version": "5.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": "^4.3.2",
23
+ "@oslokommune/punkt-assets": "^5.0.1",
24
24
  "astro": "^2.0.2",
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": "e241cba34504540a74742463c48466ec4ccd7259"
58
+ "gitHead": "41429621015d5754f8d2cadc7f2ac627a48dc12e"
59
59
  }