@oslokommune/punkt-css 9.2.6 → 9.4.0

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +1 -1
  3. package/dist/css/components/alert.css +18 -16
  4. package/dist/css/components/alert.min.css +1 -1
  5. package/dist/css/components/badge.css +2 -13
  6. package/dist/css/components/badge.min.css +1 -1
  7. package/dist/css/components/footer.css +5 -5
  8. package/dist/css/components/footer.min.css +1 -1
  9. package/dist/css/components/header.css +20 -11
  10. package/dist/css/components/header.min.css +1 -1
  11. package/dist/css/components/inputwrapper.css +21 -20
  12. package/dist/css/components/inputwrapper.min.css +1 -1
  13. package/dist/css/components/linkcard.css +21 -12
  14. package/dist/css/components/linkcard.min.css +1 -1
  15. package/dist/css/components/messagebox.css +12 -12
  16. package/dist/css/components/messagebox.min.css +1 -1
  17. package/dist/css/components/tag.css +126 -40
  18. package/dist/css/components/tag.min.css +1 -1
  19. package/dist/css/components/textinput.css +61 -35
  20. package/dist/css/components/textinput.min.css +1 -1
  21. package/dist/css/pkt-base.css +1418 -243
  22. package/dist/css/pkt-base.min.css +1 -1
  23. package/dist/css/pkt-components.css +286 -164
  24. package/dist/css/pkt-components.min.css +1 -1
  25. package/dist/css/pkt-elements.css +487 -344
  26. package/dist/css/pkt-elements.min.css +1 -1
  27. package/dist/css/pkt.css +2130 -716
  28. package/dist/css/pkt.min.css +1 -1
  29. package/dist/scss/abstracts/variables/_colors.scss +108 -0
  30. package/dist/scss/abstracts/variables/_spacing.scss +12 -10
  31. package/dist/scss/base/_colors.scss +111 -9
  32. package/dist/scss/base/_typography.scss +15 -58
  33. package/dist/scss/components/_alert.scss +28 -25
  34. package/dist/scss/components/_badge.scss +56 -55
  35. package/dist/scss/components/_footer.scss +5 -8
  36. package/dist/scss/components/_header.scss +30 -16
  37. package/dist/scss/components/_inputwrapper.scss +27 -24
  38. package/dist/scss/components/_linkcard.scss +41 -16
  39. package/dist/scss/components/_messagebox.scss +16 -14
  40. package/dist/scss/components/_tag.scss +150 -41
  41. package/dist/scss/elements/_button.scss +220 -156
  42. package/dist/scss/elements/_checkbox-radio.scss +86 -150
  43. package/dist/scss/elements/_form.scss +26 -24
  44. package/dist/scss/elements/_hr.scss +1 -1
  45. package/dist/scss/elements/_input.scss +63 -41
  46. package/dist/scss/elements/_list.scss +11 -6
  47. package/dist/scss/elements/_section.scss +8 -8
  48. package/dist/scss/elements/_table.scss +13 -9
  49. package/package.json +2 -2
@@ -1,3 +1,111 @@
1
+ $pkt-colors: (
2
+ // Blue
3
+ brand-blue-100: #F1FDFF,
4
+ brand-blue-200: #E5FCFF,
5
+ brand-blue-300: #D1F9FF,
6
+ brand-blue-500: #B3F5FF,
7
+ brand-blue-1000: #6FE9FF,
8
+ brand-dark-blue-700: #6A698B,
9
+ brand-dark-blue-1000: #2A2859,
10
+ brand-warm-blue-1000: #1F42AA,
11
+ // Green
12
+ brand-green-400: #C7FDE9,
13
+ brand-green-1000: #43F8B6,
14
+ brand-light-green-400: #E5FFE6,
15
+ brand-light-green-1000: #C7F6C9,
16
+ brand-dark-green-1000: #034B45,
17
+
18
+ // Yellow
19
+ brand-yellow-1000: #F9C66B,
20
+ brand-yellow-500: #FFE7BC,
21
+
22
+ // Red
23
+ brand-red-100: #FFF2F1,
24
+ brand-red-400: #FFDFDC,
25
+ brand-red-600: #FFB4AC,
26
+ brand-red-1000: #FF8274,
27
+
28
+ // Beige
29
+ brand-light-beige-1000: #F8F0DD,
30
+ brand-dark-beige-1000: #D0BFAE,
31
+
32
+ // Neutrals
33
+ brand-neutrals-white: #FFFFFF,
34
+ brand-neutrals-100: #F9F9F9,
35
+ brand-neutrals-200: #F2F2F2,
36
+ brand-neutrals-1000: #2C2C2C,
37
+ brand-neutrals-black: #000000,
38
+ brand-neutrals-transparent: transparent,
39
+
40
+ // Purple
41
+ brand-purple-1000: #E0ADFF,
42
+
43
+ // Grays
44
+ grays-gray-100: #E6E6E6,
45
+ grays-gray-200: #CCCCCC,
46
+ grays-gray-300: #B3B3B3,
47
+ grays-gray-400: #9A9A9A,
48
+ grays-gray-500: #808080,
49
+ grays-gray-600: #666666,
50
+ grays-gray-700: #4D4D4D,
51
+ grays-gray-800: #333333,
52
+ grays-gray-900: #1A1A1A,
53
+ grays-gray-1000: #2C2C2C,
54
+ ) !default;
55
+
56
+ $pkt-semantic-colors: (
57
+ // Background
58
+ background-card: map-get($pkt-colors, brand-neutrals-white),
59
+ background-default: map-get($pkt-colors, brand-neutrals-white),
60
+ background-subtle: map-get($pkt-colors, brand-neutrals-100),
61
+ background-transparent: map-get($pkt-colors, brand-neutrals-transparent),
62
+ // Borders
63
+ border-default: map-get($pkt-colors, brand-dark-blue-1000),
64
+ border-beige: map-get($pkt-colors, brand-dark-beige-1000),
65
+ border-blue: map-get($pkt-colors, brand-blue-1000),
66
+ border-gray: map-get($pkt-colors, grays-gray-200),
67
+ border-green: map-get($pkt-colors, brand-green-1000),
68
+ border-light-beige: map-get($pkt-colors, brand-light-beige-1000),
69
+ border-red: map-get($pkt-colors, brand-red-1000),
70
+ border-subtle: map-get($pkt-colors, brand-neutrals-200),
71
+ border-yellow: map-get($pkt-colors, brand-yellow-1000),
72
+ border-states-active: map-get($pkt-colors, brand-warm-blue-1000),
73
+ border-states-disabled: map-get($pkt-colors, grays-gray-300),
74
+ border-states-focus: map-get($pkt-colors, brand-purple-1000),
75
+ border-states-hover: map-get($pkt-colors, brand-warm-blue-1000),
76
+ // Surface
77
+ surface-default-faded-green: map-get($pkt-colors, brand-light-green-400),
78
+ surface-default-faded-red: map-get($pkt-colors, brand-red-400),
79
+ surface-default-gray: map-get($pkt-colors, brand-neutrals-100),
80
+ surface-default-light-beige: map-get($pkt-colors, brand-light-beige-1000),
81
+ surface-default-light-blue: map-get($pkt-colors, brand-blue-300),
82
+ surface-default-light-green: map-get($pkt-colors, brand-green-400),
83
+ surface-default-red: map-get($pkt-colors, brand-red-600),
84
+ surface-default-yellow: map-get($pkt-colors, brand-yellow-500),
85
+ surface-strong-beige: map-get($pkt-colors, brand-dark-beige-1000),
86
+ surface-strong-blue: map-get($pkt-colors, brand-blue-1000),
87
+ surface-strong-dark-blue: map-get($pkt-colors, brand-dark-blue-1000),
88
+ surface-strong-dark-green: map-get($pkt-colors, brand-dark-green-1000),
89
+ surface-strong-gray: map-get($pkt-colors, brand-neutrals-200),
90
+ surface-strong-green: map-get($pkt-colors, brand-green-1000),
91
+ surface-strong-light-green: map-get($pkt-colors, brand-light-green-1000),
92
+ surface-strong-red: map-get($pkt-colors, brand-red-1000),
93
+ surface-strong-yellow: map-get($pkt-colors, brand-yellow-1000),
94
+ surface-subtle-light-blue: map-get($pkt-colors, brand-blue-200),
95
+ surface-subtle-light-red: map-get($pkt-colors, brand-red-100),
96
+ surface-subtle-pale-blue: map-get($pkt-colors, brand-blue-100),
97
+ surface-subtle-white: map-get($pkt-colors, brand-neutrals-white),
98
+ // Text
99
+ text-body-dark: map-get($pkt-colors, brand-dark-blue-1000),
100
+ text-body-default: map-get($pkt-colors, brand-dark-blue-1000),
101
+ text-body-light: map-get($pkt-colors, brand-neutrals-white),
102
+ text-placeholder: map-get($pkt-colors, grays-gray-600),
103
+ text-action-disabled: map-get($pkt-colors, grays-gray-600),
104
+ text-action-active: map-get($pkt-colors, brand-warm-blue-1000),
105
+ text-action-hover: map-get($pkt-colors, brand-warm-blue-1000),
106
+ text-action-normal: map-get($pkt-colors, brand-dark-blue-1000)) !default;
107
+
108
+ // Deprecated colors
1
109
  $colors: (
2
110
  // brand
3
111
  color-blue: #6fe9ff,
@@ -14,16 +14,18 @@ $spacing: (
14
14
  'size-56': 3.5rem,
15
15
  'size-64': 4rem,
16
16
  'size-72': 4.5rem,
17
+ 'size-80': 5rem,
17
18
  'size-88': 5.5rem,
18
19
  'size-104': 6.5rem,
19
20
  'size-128': 8rem,
20
- 'size-5': 0.3125rem /* deprecated */,
21
- 'size-10': 0.625rem /* deprecated */,
22
- 'size-15': 0.9375rem /* deprecated */,
23
- 'size-20': 1.25rem /* deprecated */,
24
- 'size-30': 1.875rem /* deprecated */,
25
- 'size-50': 3.125rem /* deprecated */,
26
- 'size-60': 3.75rem /* deprecated */,
27
- 'size-75': 4.6875rem /* deprecated */,
28
- 'size-100': 6.25rem /* deprecated */,
29
- ) !default;
21
+ /* deprecated */
22
+ 'size-5': 0.3125rem,
23
+ 'size-10': 0.625rem,
24
+ 'size-15': 0.9375rem,
25
+ 'size-20': 1.25rem,
26
+ 'size-30': 1.875rem,
27
+ 'size-50': 3.125rem,
28
+ 'size-60': 3.75rem,
29
+ 'size-75': 4.6875rem,
30
+ 'size-100': 6.25rem,
31
+ ) !default;
@@ -1,24 +1,126 @@
1
1
  /*
2
2
  * Colors
3
+ * Brand
4
+ * Light mode
5
+ * Dark mode
3
6
  */
4
7
 
5
8
  @use "../abstracts/variables";
6
9
 
7
10
  :root {
11
+
8
12
  /**
9
- * @tokens Colors
10
- * @presenter Color
11
- */
13
+ * @tokens Colors
14
+ * @presenter Color
15
+ */
16
+ // Brand
17
+ @each $name, $color in variables.$pkt-colors {
18
+ --pkt-color-#{$name}: #{$color};
19
+ }
20
+
21
+ // Semantic
22
+ @each $name, $color in variables.$pkt-semantic-colors {
23
+ --pkt-color-#{$name}: #{$color};
24
+ }
25
+
26
+ // Lager css-klasser basert på pkt-fargevariabler
27
+ @each $name, $color in variables.$pkt-colors {
28
+ .pkt-color-bg-#{$name} {
29
+ background-color: $color !important;
30
+ }
31
+
32
+ .pkt-color-txt-#{$name} {
33
+ color: $color !important;
34
+ }
35
+
36
+ .pkt-color-border-#{$name} {
37
+ border-color: $color !important;
38
+ }
39
+ }
40
+
41
+ // Lager css-klasser basert på semantiske variabler
42
+ @each $name, $color in variables.$pkt-semantic-colors {
43
+ .pkt-color-bg-#{$name} {
44
+ background-color: var(--pkt-color-#{$name}) !important;
45
+ }
46
+
47
+ .pkt-color-txt-#{$name} {
48
+ color: var(--pkt-color-#{$name}) !important;
49
+ }
50
+
51
+ .pkt-color-border-#{$name} {
52
+ border-color: var(--pkt-color-#{$name}) !important;
53
+ }
54
+ }
55
+
56
+ // Deprecated colors
12
57
  @each $name, $color in variables.$colors {
13
58
  --#{$name}: #{$color};
14
59
  }
15
- }
16
60
 
17
- @each $name, $color in variables.$colors {
18
- .bg-#{$name} {
19
- background-color: $color !important;
61
+ // Lager css-klasser basert gamle fargevariabler - deprecated
62
+ @each $name, $color in variables.$colors {
63
+ .bg-#{$name} {
64
+ background-color: $color !important;
65
+ }
66
+
67
+ .txt-#{$name} {
68
+ color: $color !important;
69
+ }
20
70
  }
21
- .txt-#{$name} {
22
- color: $color !important;
71
+
72
+ // Dark mode
73
+ [data-mode="dark"] {
74
+ // Background
75
+ --pkt-color-background-card: var(--pkt-color-grays-gray-700);
76
+ --pkt-color-background-default: var(--pkt-color-grays-gray-1000);
77
+ --pkt-color-background-subtle: var(--pkt-color-grays-gray-1000);
78
+ --pkt-color-background-transparent: var(--pkt-color-brand-neutrals-transparent);
79
+
80
+ // Borders
81
+ --pkt-color-border-default: var(--pkt-color-brand-neutrals-white);
82
+ --pkt-color-border-beige: var(--pkt-color-brand-dark-beige-1000);
83
+ --pkt-color-border-blue: var(--pkt-color-brand-blue-1000);
84
+ --pkt-color-border-green: var(--pkt-color-brand-green-1000);
85
+ --pkt-color-border-light-beige: var(--pkt-color-brand-light-beige-1000);
86
+ --pkt-color-border-red: var(--pkt-color-brand-red-1000);
87
+ --pkt-color-border-subtle: var(--pkt-color-brand-dark-blue-700);
88
+ --pkt-color-border-yellow: var(--pkt-color-brand-yellow-1000);
89
+ --pkt-color-border-states-active: var(--pkt-color-brand-blue-500);
90
+ --pkt-color-border-states-disabled: var(--pkt-color-grays-gray-500);
91
+ --pkt-color-border-states-focus: var(--pkt-color-brand-purple-1000);
92
+ --pkt-color-border-states-hover: var(--pkt-color-brand-blue-500);
93
+ // Surface
94
+ --pkt-color-surface-default-faded-green: var(--pkt-color-brand-light-green-400);
95
+ --pkt-color-surface-default-faded-red: var(--pkt-color-brand-red-400);
96
+ --pkt-color-surface-default-gray: var(--pkt-color-brand-neutrals-100);
97
+ --pkt-color-surface-default-light-beige: var(--pkt-color-brand-light-beige-1000);
98
+ --pkt-color-surface-default-light-blue: var(--pkt-color-brand-blue-300);
99
+ --pkt-color-surface-default-light-green: var(--pkt-color-brand-green-400);
100
+ --pkt-color-surface-default-red: var(--pkt-color-brand-red-600);
101
+ --pkt-color-surface-default-yellow: var(--pkt-color-brand-yellow-500);
102
+ --pkt-color-surface-strong-beige: var(--pkt-color-brand-dark-beige-1000);
103
+ --pkt-color-surface-strong-blue: var(--pkt-color-brand-blue-1000);
104
+ --pkt-color-surface-strong-dark-blue: var(--pkt-color-brand-dark-blue-1000);
105
+ --pkt-color-surface-strong-dark-green: var(--pkt-color-brand-dark-green-1000);
106
+ --pkt-color-surface-strong-gray: var(--pkt-color-brand-neutrals-200);
107
+ --pkt-color-surface-strong-green: var(--pkt-color-brand-green-1000);
108
+ --pkt-color-surface-strong-light-green: var(--pkt-color-brand-light-green-1000);
109
+ --pkt-color-surface-strong-red: var(--pkt-color-brand-red-1000);
110
+ --pkt-color-surface-strong-yellow: var(--pkt-color-brand-yellow-1000);
111
+ --pkt-color-surface-subtle-light-blue: var(--pkt-color-brand-blue-200);
112
+ --pkt-color-surface-subtle-light-red: var(--pkt-color-brand-red-100);
113
+ --pkt-color-surface-subtle-pale-blue: var(--pkt-color-brand-blue-100);
114
+ --pkt-color-surface-subtle-white: var(--pkt-color-brand-neutrals-white);
115
+
116
+ // Text
117
+ --pkt-color-text-body-dark: var(--pkt-color-brand-dark-blue-1000);
118
+ --pkt-color-text-body-default: var(--pkt-color-brand-neutrals-white);
119
+ --pkt-color-text-body-light: var(--pkt-color-brand-neutrals-white);
120
+ --pkt-color-text-placeholder: var(--pkt-color-grays-gray-300);
121
+ --pkt-color-text-action-disabled: var(--pkt-color-grays-gray-200);
122
+ --pkt-color-text-action-active: var(--pkt-color-brand-blue-500);
123
+ --pkt-color-text-action-hover: var(--pkt-color-brand-blue-500);
124
+ --pkt-color-text-action-normal: var(--pkt-color-brand-neutrals-white);
23
125
  }
24
126
  }
@@ -11,7 +11,7 @@
11
11
  @use '../abstracts/functions';
12
12
 
13
13
  body {
14
- color: var(--color-blue-dark);
14
+ color: var(--pkt-color-text-body-default);
15
15
  font-family: #{map.get(variables.$font-family, 'normal')};
16
16
  font-size: map.get(variables.$font-size, 'size-16');
17
17
  font-weight: map.get(variables.$font-weight, 'light');
@@ -38,83 +38,42 @@ a,
38
38
  // link, visited, hover, focus, active
39
39
  // but we don't use visited, so we can skip :link
40
40
 
41
- color: var(--color-blue-dark);
41
+ color: var(--pkt-color-text-action-normal);
42
42
  text-decoration: underline;
43
43
  word-wrap: break-word;
44
44
  cursor: pointer;
45
+
45
46
  // visited
46
- &:visited {
47
- color: var(--color-blue-dark);
47
+ &:visited:not(.pkt-linkcard) {
48
+ color: inherit;
48
49
  }
49
50
 
50
51
  // hover
51
52
  &:hover,
52
53
  &.pkt-link--hover {
53
- color: var(--color-hover);
54
+ color: var(--pkt-color-text-action-active);
54
55
  text-decoration: underline;
55
56
  }
56
57
 
57
58
  // focus
58
59
  &:focus-visible,
59
60
  &.pkt-link--focus {
60
- box-shadow: 0px 0px 0px 0.125rem var(--color-active),
61
- 0px 0px 0px 0.375rem var(--color-focus);
61
+ box-shadow: 0px 0px 0px 0.125rem var(--pkt-color-text-action-active),
62
+ 0px 0px 0px 0.375rem var(--pkt-color-border-states-focus);
62
63
  outline: none;
63
- color: var(--color-hover);
64
+ color: var(--pkt-color-text-action-active);
64
65
  }
65
66
 
66
67
  &:focus:not(:focus-visible) {
67
68
  box-shadow: none;
68
- outline: 0.125rem solid var(--color-active);
69
- color: var(--color-hover);
69
+ outline: 0.125rem solid var(--pkt-color-text-action-active);
70
+ color: var(--pkt-color-text-action-active);
70
71
  }
71
72
 
72
73
  // active
73
74
  &:active,
74
75
  &.pkt-link--active {
75
- color: var(--color-active);
76
- }
77
-
78
- @at-root [data-mode='dark'] a {
79
- // link
80
- &:link,
81
- &.pkt-link--link {
82
- color: var(--color-white);
83
- text-decoration: underline;
84
- word-wrap: break-word;
85
- }
86
-
87
- // visited
88
- &:visited {
89
- color: var(--color-white);
90
- }
91
-
92
- // hover
93
- &:hover,
94
- &.pkt-link--hover {
95
- color: var(--color-hover-light);
96
- }
97
-
98
- // focus
99
- &:focus-visible,
100
- &.pkt-link--focus {
101
- box-shadow: 0px 0px 0px 0.125rem var(--color-active-light),
102
- 0px 0px 0px 0.375rem var(--color-focus);
103
- outline: none;
104
- color: var(--color-hover-light);
105
- }
106
-
107
- &:focus:not(:focus-visible) {
108
- box-shadow: none;
109
- outline: 0.125rem solid var(--color-focus);
110
- color: var(--color-hover-light);
111
- }
112
-
113
- // active
114
- &:active,
115
- &.pkt-link--active {
116
- color: var(--color-active-light);
117
- }
76
+ color: var(--pkt-color-text-action-active);
118
77
  }
119
78
  }
120
79
 
@@ -143,7 +102,7 @@ a,
143
102
 
144
103
  &--external::after {
145
104
  content: ' ';
146
- --svg: url(https://punkt-cdn.oslo.kommune.no/9.2/icons/new-window-small.svg);
105
+ --svg: url(https://punkt-cdn.oslo.kommune.no/9.4/icons/new-window-small.svg);
147
106
  background-image: var(--svg);
148
107
  background-repeat: no-repeat;
149
108
  background-size: 18px 18px;
@@ -153,8 +112,7 @@ a,
153
112
 
154
113
  &--external:hover::after {
155
114
  // #1f42aa
156
- filter: brightness(0) saturate(100%) invert(16%) sepia(99%) saturate(2420%)
157
- hue-rotate(222deg) brightness(93%) contrast(90%);
115
+ filter: brightness(0) saturate(100%) invert(16%) sepia(99%) saturate(2420%) hue-rotate(222deg) brightness(93%) contrast(90%);
158
116
  }
159
117
  }
160
118
 
@@ -176,8 +134,7 @@ button.pkt-link {
176
134
 
177
135
  &--external:hover::after {
178
136
  // #b3f5ff
179
- filter: brightness(0) saturate(100%) invert(80%) sepia(54%) saturate(502%)
180
- hue-rotate(173deg) brightness(109%) contrast(105%);
137
+ filter: brightness(0) saturate(100%) invert(80%) sepia(54%) saturate(502%) hue-rotate(173deg) brightness(109%) contrast(105%);
181
138
  }
182
139
  }
183
140
  }
@@ -14,42 +14,42 @@ $-border-thickness: map.get(variables.$spacing, 'size-4');
14
14
 
15
15
  // default is "info"
16
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);
17
+ --pkt-color-alert-bc: var(--pkt-color-border-blue);
18
+ --pkt-color-alert-bg: var(--pkt-color-surface-default-light-blue);
19
+ --pkt-color-alert-txt: var(--pkt-color-text-body-dark);
20
+ --pkt-color-alert-icon-fg: var(--pkt-color-brand-dark-blue-1000);
21
+ --pkt-color-alert-close-fg: var(--pkt-color-brand-dark-blue-1000);
22
22
  }
23
+
23
24
  .#{$-module-name}--error {
24
- --pkt-alert-bc: var(--color-red);
25
- --pkt-alert-bg: var(--color-red-30);
25
+ --pkt-color-alert-bc: var(--pkt-color-border-red);
26
+ --pkt-color-alert-bg: var(--pkt-color-surface-default-faded-red);
26
27
  }
27
28
 
28
29
  .#{$-module-name}--success {
29
- --pkt-alert-bc: var(--color-green);
30
- --pkt-alert-bg: var(--color-green-30);
30
+ --pkt-color-alert-bc: var(--pkt-color-border-green);
31
+ --pkt-color-alert-bg: var(--pkt-color-surface-default-light-green);
31
32
  }
32
33
 
33
34
  .#{$-module-name}--warning {
34
- --pkt-alert-bc: var(--color-yellow);
35
- --pkt-alert-bg: var(--color-yellow-50);
35
+ --pkt-color-alert-bc: var(--pkt-color-border-yellow);
36
+ --pkt-color-alert-bg: var(--pkt-color-surface-default-yellow);
36
37
  }
37
38
 
38
39
  .#{$-module-name} {
39
- padding: $-alert-spacing $-alert-spacing $-alert-spacing
40
- calc($-alert-spacing - $-border-thickness);
40
+ padding: $-alert-spacing $-alert-spacing $-alert-spacing calc($-alert-spacing - $-border-thickness);
41
41
  display: block;
42
42
  position: relative;
43
- border-left: $-border-thickness solid var(--pkt-alert-bc);
44
- background-color: var(--pkt-alert-bg);
45
- color: var(--pkt-alert-txt);
43
+ border-left: $-border-thickness solid var(--pkt-color-alert-bc);
44
+ background-color: var(--pkt-color-alert-bg);
45
+ color: var(--pkt-color-alert-txt);
46
46
 
47
47
  &__title {
48
48
  @include get-text('pkt-txt-18-medium');
49
49
  margin: 0 0 $-alert-spacing 2.5rem;
50
50
  }
51
51
 
52
- &__close ~ &__title {
52
+ &__close~&__title {
53
53
  margin: 0 4rem $-alert-spacing 2.5rem;
54
54
  }
55
55
 
@@ -63,17 +63,18 @@ $-border-thickness: map.get(variables.$spacing, 'size-4');
63
63
  &:first-of-type {
64
64
  margin-top: 0;
65
65
  }
66
+
66
67
  &:last-of-type {
67
68
  margin-bottom: 0;
68
69
  }
69
70
  }
70
71
  }
71
72
 
72
- &__close + &__text {
73
+ &__close+&__text {
73
74
  margin: 0 4rem 0 2.5rem;
74
75
  }
75
76
 
76
- &__title + &__text {
77
+ &__title+&__text {
77
78
  margin-left: 0;
78
79
  margin-right: 0;
79
80
  }
@@ -84,8 +85,7 @@ $-border-thickness: map.get(variables.$spacing, 'size-4');
84
85
  }
85
86
 
86
87
  &__icon {
87
- --fg-color: var(--pkt-alert-icon-fg);
88
-
88
+ --fg-color: var(--pkt-color-alert-icon-fg);
89
89
  height: 2rem;
90
90
  width: 2rem;
91
91
  position: absolute;
@@ -94,24 +94,27 @@ $-border-thickness: map.get(variables.$spacing, 'size-4');
94
94
  }
95
95
 
96
96
  &__close {
97
- --fg-color: var(--pkt-alert-close-fg);
98
97
  position: absolute;
99
98
  right: 1.125rem;
100
99
  top: 0.625rem;
100
+
101
+ & svg {
102
+ --fg-color: var(--pkt-color-alert-close-fg);
103
+ }
101
104
  }
102
105
  }
103
106
 
104
107
  // Utelukkende for bruk i feilmeldinger i InputWrapper
105
108
  .#{$-module-name}--slim {
106
- padding: map.get(variables.$spacing, 'size-12')
107
- map.get(variables.$spacing, 'size-16')
108
- map.get(variables.$spacing, 'size-12') map.get(variables.$spacing, 'size-4');
109
+ padding: map.get(variables.$spacing, 'size-12') map.get(variables.$spacing, 'size-16') map.get(variables.$spacing, 'size-12') map.get(variables.$spacing, 'size-4');
110
+
109
111
  .#{$-module-name}__icon {
110
112
  width: 1.375rem;
111
113
  height: 1.375rem;
112
114
  top: 0.81rem;
113
115
  left: 1.25rem;
114
116
  }
117
+
115
118
  .#{$-module-name}__text {
116
119
  @include get-text('pkt-txt-16-light');
117
120
  margin: 0 0 0 2.875rem;
@@ -1,59 +1,60 @@
1
1
  /*
2
2
  * Badge element
3
+ * DEPRECATED - use tag instead
3
4
  */
4
5
 
5
- @use 'sass:map';
6
- @use '../abstracts/variables';
7
-
8
- .pkt-badge {
9
- display: inline-flex;
10
- height: 1.5em;
11
- margin-left: 0.4em;
12
- padding: 0.25em 0.4em;
13
- color: black;
14
- font-weight: 500;
15
- font-size: 0.75em;
16
- line-height: 1em;
17
- background: map.get(variables.$colors, 'color-blue-light');
18
- border-radius: 1px;
19
- }
20
-
21
- .pkt-btn > .pkt-badge.pkt-badge--strong,
22
- .pkt-badge--strong {
23
- color: map.get(variables.$colors, 'color-blue-light');
24
- background: map.get(variables.$colors, 'color-blue-dark');
25
- }
26
-
27
- .pkt-btn > .pkt-badge.pkt-badge--info,
28
- .pkt-badge--info {
29
- background: map.get(variables.$colors, 'color-yellow');
30
- }
31
-
32
- // Reduce size when used inside headings
33
- .pkt-badge.pkt-badge--small,
34
- .pkt-h1 > .pkt-badge,
35
- .pkt-h2 > .pkt-badge,
36
- .pkt-h3 > .pkt-badge {
37
- font-size: 0.5em;
38
- transform: translateY(-0.25em);
39
- }
40
-
41
- // Badges for buttons
42
- .pkt-btn:not(.pkt-btn--ter) > .pkt-badge {
43
- color: inherit;
44
- background: transparent;
45
- border: 1px solid map.get(variables.$colors, 'color-blue-dark');
46
- border-radius: 4px;
47
- }
48
-
49
- .pkt-btn--pri:not(.pkt-btn--neg) > .pkt-badge,
50
- .pkt-btn--neg.pkt-btn--ter > .pkt-badge,
51
- .pkt-btn--neg.pkt-btn--ghost > .pkt-badge {
52
- border-color: white;
53
- }
54
-
55
- // Hack to fix pixel alignment on small buttons
56
- .pkt-btn--small > .pkt-badge {
57
- padding-top: 0.28em;
58
- transform: translateY(-0.1em);
59
- }
6
+ @use 'sass:map';
7
+ @use '../abstracts/variables';
8
+
9
+ .pkt-badge {
10
+ display: inline-flex;
11
+ height: 1.5em;
12
+ margin-left: 0.4em;
13
+ padding: 0.25em 0.4em;
14
+ color: black;
15
+ font-weight: 500;
16
+ font-size: 0.75em;
17
+ line-height: 1em;
18
+ background: map.get(variables.$pkt-colors, 'pkt-color-brand-blue-500');
19
+ border-radius: 1px;
20
+ }
21
+
22
+ .pkt-btn>.pkt-badge.pkt-badge--strong,
23
+ .pkt-badge--strong {
24
+ color: map.get(variables.$pkt-colors, 'pkt-color-brand-blue-500');
25
+ background: map.get(variables.$pkt-colors, 'pkt-color-brand-dark-blue-1000');
26
+ }
27
+
28
+ .pkt-btn>.pkt-badge.pkt-badge--info,
29
+ .pkt-badge--info {
30
+ background: map.get(variables.$pkt-colors, 'pkt-color-brand-yellow-1000');
31
+ }
32
+
33
+ // Reduce size when used inside headings
34
+ .pkt-badge.pkt-badge--small,
35
+ .pkt-h1>.pkt-badge,
36
+ .pkt-h2>.pkt-badge,
37
+ .pkt-h3>.pkt-badge {
38
+ font-size: 0.5em;
39
+ transform: translateY(-0.25em);
40
+ }
41
+
42
+ // Badges for buttons
43
+ .pkt-btn:not(.pkt-btn--ter)>.pkt-badge {
44
+ color: inherit;
45
+ background: transparent;
46
+ border: 1px solid map.get(variables.$pkt-colors, 'pkt-color-brand-dark-blue-1000');
47
+ border-radius: 4px;
48
+ }
49
+
50
+ .pkt-btn--pri:not(.pkt-btn--neg)>.pkt-badge,
51
+ .pkt-btn--neg.pkt-btn--ter>.pkt-badge,
52
+ .pkt-btn--neg.pkt-btn--ghost>.pkt-badge {
53
+ border-color: white;
54
+ }
55
+
56
+ // Hack to fix pixel alignment on small buttons
57
+ .pkt-btn--small>.pkt-badge {
58
+ padding-top: 0.28em;
59
+ transform: translateY(-0.1em);
60
+ }