@oslokommune/punkt-css 12.34.0 → 12.34.2

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.
@@ -9,7 +9,10 @@
9
9
  $-module-name: 'pkt-alert';
10
10
 
11
11
  // Spacing
12
- $-alert-spacing: map.get(variables.$spacing, 'size-24');
12
+ $-spacing-8: map.get(variables.$spacing, 'size-8');
13
+ $-spacing-12: map.get(variables.$spacing, 'size-12');
14
+ $-spacing-16: map.get(variables.$spacing, 'size-16');
15
+ $-spacing-24: map.get(variables.$spacing, 'size-24');
13
16
  $-border-thickness: map.get(variables.$spacing, 'size-4');
14
17
 
15
18
  // default is "info"
@@ -46,25 +49,45 @@ pkt-alert {
46
49
  display: block;
47
50
  }
48
51
 
52
+ .pkt-alert__grid {
53
+ display: grid;
54
+ grid-template-columns: min-content auto min-content;
55
+ grid-row-gap: $-spacing-16;
56
+ grid-column-gap: $-spacing-24;
57
+ justify-items: left;
58
+ align-items: center;
59
+ }
60
+
61
+ .pkt-alert__noTitle {
62
+ .pkt-alert__text {
63
+ grid-row: 1/2;
64
+ grid-column: 2/3;
65
+ }
66
+
67
+ @media (max-width: 768px) {
68
+ .pkt-alert__text {
69
+ grid-row: 2 / 3;
70
+ grid-column: 1 / -1;
71
+ }
72
+ }
73
+ }
74
+
49
75
  .pkt-alert {
50
- padding: $-alert-spacing $-alert-spacing $-alert-spacing calc($-alert-spacing - $-border-thickness);
51
- display: block;
52
- position: relative;
53
76
  border-left: $-border-thickness solid var(--pkt-color-alert-bc);
54
77
  background-color: var(--pkt-color-alert-bg);
55
78
  color: var(--pkt-color-alert-txt);
79
+ padding: $-spacing-16 $-spacing-24;
80
+
81
+ display: block;
56
82
 
57
83
  &__title {
58
- margin: 0 0 $-alert-spacing 2.5rem;
84
+ grid-column: 2 / 3;
59
85
  @include get-text('pkt-txt-18-medium');
60
86
  }
61
87
 
62
- &__close ~ &__title {
63
- margin: 0 4rem $-alert-spacing 2.5rem;
64
- }
65
-
66
88
  &__text {
67
- margin: 0 0 0 2.5rem;
89
+ grid-column: 1 / -1;
90
+ grid-row: 2 / 3;
68
91
  overflow-wrap: break-word;
69
92
 
70
93
  @include get-text('pkt-txt-18-light');
@@ -82,18 +105,9 @@ pkt-alert {
82
105
  }
83
106
  }
84
107
 
85
- &__close + &__text {
86
- margin: 0 4rem 0 2.5rem;
87
- }
88
-
89
- &__title + &__text {
90
- margin-left: 0;
91
- margin-right: 0;
92
- }
93
-
94
108
  &__date {
95
- margin-top: $-alert-spacing;
96
-
109
+ grid-column: 1 / -1;
110
+ grid-row: 3 / 4;
97
111
  @include get-text('pkt-txt-14-light');
98
112
  }
99
113
 
@@ -101,15 +115,14 @@ pkt-alert {
101
115
  --fg-color: var(--pkt-color-alert-icon-fg);
102
116
  height: 2rem;
103
117
  width: 2rem;
104
- position: absolute;
105
- top: 22px;
106
- left: 20px;
118
+ grid-area: icon;
119
+ grid-row: 1 / 2;
120
+ grid-column: 1 / 2;
107
121
  }
108
122
 
109
123
  &__close {
110
- position: absolute;
111
- right: 1.125rem;
112
- top: 0.625rem;
124
+ grid-column: 3/4;
125
+ grid-row: 1/2;
113
126
 
114
127
  & svg {
115
128
  --fg-color: var(--pkt-color-alert-close-fg);
@@ -118,21 +131,22 @@ pkt-alert {
118
131
  }
119
132
 
120
133
  .pkt-alert--compact {
121
- padding: map.get(variables.$spacing, 'size-12') map.get(variables.$spacing, 'size-16')
122
- map.get(variables.$spacing, 'size-12') map.get(variables.$spacing, 'size-4');
134
+ padding: $-spacing-12 $-spacing-16;
135
+
136
+ .pkt-alert__grid {
137
+ gap: $-spacing-8;
138
+ }
123
139
 
124
140
  .pkt-alert__icon {
125
141
  width: 1.375rem;
126
142
  height: 1.375rem;
127
- top: 0.81rem;
128
- left: 1.25rem;
143
+ }
144
+
145
+ .pkt-alert__title {
146
+ @include get-text('pkt-txt-16-medium');
129
147
  }
130
148
 
131
149
  .pkt-alert__text {
132
150
  @include get-text('pkt-txt-16-light');
133
- margin: 0 2.875rem;
134
- }
135
- .pkt-alert__close {
136
- top: 0.25rem;
137
151
  }
138
152
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-css",
3
- "version": "12.34.0",
3
+ "version": "12.34.2",
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",
@@ -54,5 +54,5 @@
54
54
  "url": "https://github.com/oslokommune/punkt/issues"
55
55
  },
56
56
  "license": "MIT",
57
- "gitHead": "4ab2b5b6508cf1749c9b1a66d92c6d214f737b26"
57
+ "gitHead": "780c78ea4619450ddd43ba97183c2eb239a53524"
58
58
  }