@oslokommune/punkt-css 2.0.3 → 2.0.4

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.
@@ -30,12 +30,16 @@ $colors: (
30
30
  color-blue-dark-10: #d9e9f2,
31
31
  color-blue-5: #f1fdff,
32
32
  color-blue-10: #e5fcff,
33
+ color-blue-60: #cdf5fb,
33
34
  color-green-dark-5: #f2fff3,
34
35
  color-green-dark-10: #d9f2ef,
35
36
  color-green-10: #e5ffe6,
37
+ color-green-30: #c0f6e3,
36
38
  color-red-5: #fff3f2,
37
39
  color-red-10: #ffe8e5,
40
+ color-red-30: #f9cfca,
38
41
  color-yellow-5: #fef9f0,
42
+ color-yellow-50: #fae1b6,
39
43
  // grayscale digital
40
44
  color-gray-light: #f9f9f9,
41
45
  color-gray: #f2f2f2,
@@ -6,132 +6,94 @@
6
6
  @use '../abstracts/mixins/breakpoints' as *;
7
7
  @use '../abstracts/' as *;
8
8
 
9
+ $-module-name: 'pkt-alert';
10
+
9
11
  // Spacing
10
12
  $-alert-spacing: map.get(variables.$spacing, 'size-24');
13
+ $-border-thickness: map.get(variables.$spacing, 'size-4');
14
+
15
+ // default is "info"
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);
22
+ }
23
+ .#{$-module-name}--error {
24
+ --pkt-alert-bc: var(--color-red);
25
+ --pkt-alert-bg: var(--color-red-30);
26
+ }
11
27
 
12
- //// Colors
13
- $-alert-red-error: map.get(variables.$colors, 'color-error');
14
- $-alert-green-dark: map.get(variables.$colors, 'color-green-dark');
15
- $-alert-blue-dark: map.get(variables.$colors, 'color-blue-dark');
16
-
17
- // Error
18
- $-alert-error-border: 3px solid $-alert-red-error;
19
- $-alert-error-bg: map.get(variables.$colors, 'color-red-5');
20
- $-alert-error-color: $-alert-red-error;
21
-
22
- // Success
23
- $-alert-success-border: 3px solid $-alert-green-dark;
24
- $-alert-success-bg: map.get(variables.$colors, 'color-green-dark-5');
25
- $-alert-success-color: $-alert-green-dark;
26
-
27
- // Warning
28
- $-alert-warning-border: 3px solid map.get(variables.$colors, 'color-yellow');
29
- $-alert-warning-bg: map.get(variables.$colors, 'color-yellow-5');
30
- $-alert-warning-color: map.get(variables.$colors, 'color-warning');
31
-
32
- // Info
33
- $-alert-info-border: 3px solid $-alert-blue-dark;
34
- $-alert-info-bg: map.get(variables.$colors, 'color-blue-dark-5');
35
- $-alert-info-color: $-alert-blue-dark;
28
+ .#{$-module-name}--success {
29
+ --pkt-alert-bc: var(--color-green);
30
+ --pkt-alert-bg: var(--color-green-30);
31
+ }
36
32
 
37
- // Close hover color
38
- $-alert-close-hover-color: map.get(variables.$colors, 'color-hover');
33
+ .#{$-module-name}--warning {
34
+ --pkt-alert-bc: var(--color-yellow);
35
+ --pkt-alert-bg: var(--color-yellow-50);
36
+ }
39
37
 
40
- .pkt-alert {
41
- padding: $-alert-spacing;
38
+ .#{$-module-name} {
39
+ padding: $-alert-spacing $-alert-spacing $-alert-spacing
40
+ calc($-alert-spacing - $-border-thickness);
42
41
  display: block;
43
- overflow: hidden;
44
42
  position: relative;
45
-
46
- &__text {
47
- @include get-text('pkt-txt-18-light');
48
- margin-bottom: 0;
49
- padding: 0;
50
- }
43
+ border-left: $-border-thickness solid var(--pkt-alert-bc);
44
+ background-color: var(--pkt-alert-bg);
45
+ color: var(--pkt-alert-txt);
51
46
 
52
47
  &__title {
53
48
  @include get-text('pkt-txt-18-medium');
54
- display: flex;
55
- align-items: center;
56
- margin-bottom: $-alert-spacing;
49
+ margin: 0 0 $-alert-spacing 2.5rem;
57
50
  }
58
51
 
59
- &__content {
60
- display: flex;
61
- align-items: flex-start;
52
+ &__close ~ &__title {
53
+ margin: 0 4rem $-alert-spacing 2.5rem;
62
54
  }
63
55
 
64
- &__date {
65
- @include get-text('pkt-txt-14-light');
66
- margin-top: $-alert-spacing;
67
- }
56
+ &__text {
57
+ @include get-text('pkt-txt-18-light');
58
+ margin: 0 0 0 2.5rem;
68
59
 
69
- &__close {
70
- display: flex;
71
- float: right;
72
- margin-left: $-alert-spacing;
73
- }
60
+ p {
61
+ margin-bottom: map.get(variables.$spacing, 'size-16');
74
62
 
75
- &__icon {
76
- margin-right: map.get(variables.$spacing, 'size-16');
77
- height: 1.875rem;
78
- width: 1.875rem;
79
- flex-shrink: 0;
63
+ &:last-of-type {
64
+ margin-bottom: 0;
65
+ }
66
+ }
80
67
  }
81
68
 
82
- // skins
83
- // default is "info"
84
-
85
- &--success {
86
- border-left: $-alert-success-border;
87
- background-color: $-alert-success-bg;
88
- color: $-alert-success-color;
69
+ &__close + &__text {
70
+ margin: 0 4rem 0 2.5rem;
71
+ }
89
72
 
90
- &.pkt-alert .pkt-alert__icon {
91
- --bg-color: var(--color-green-dark);
92
- --fg-color: var(--color-green-dark-5);
93
- }
94
- &.pkt-alert .pkt-alert__close {
95
- --fg-color: var(--color-green-dark);
96
- }
73
+ &__title + &__text {
74
+ margin-left: 0;
75
+ margin-right: 0;
97
76
  }
98
77
 
99
- &--error {
100
- border-left: $-alert-error-border;
101
- background-color: $-alert-error-bg;
102
- color: $-alert-error-color;
103
- &.pkt-alert .pkt-alert__icon {
104
- --bg-color: var(--color-error);
105
- --fg-color: var(--color-red-5);
106
- }
107
- &.pkt-alert .pkt-alert__close {
108
- --fg-color: var(--color-error);
109
- }
78
+ &__date {
79
+ @include get-text('pkt-txt-14-light');
80
+ margin-top: $-alert-spacing;
110
81
  }
111
82
 
112
- &--warning {
113
- border-left: $-alert-warning-border;
114
- background-color: $-alert-warning-bg;
115
- color: $-alert-warning-color;
116
- &.pkt-alert .pkt-alert__icon {
117
- --bg-color: var(--color-yellow);
118
- --fg-color: var(--color-blue-dark);
119
- }
120
- &.pkt-alert .pkt-alert__close {
121
- --fg-color: var(--color-warning);
122
- }
83
+ &__icon {
84
+ --fg-color: var(--pkt-alert-icon-fg);
85
+
86
+ height: 2rem;
87
+ width: 2rem;
88
+ position: absolute;
89
+ top: 22px;
90
+ left: 20px;
123
91
  }
124
92
 
125
- &--info {
126
- border-left: $-alert-info-border;
127
- background-color: $-alert-info-bg;
128
- color: $-alert-info-color;
129
- &.pkt-alert .pkt-alert__icon {
130
- --bg-color: var(--color-blue);
131
- --fg-color: var(--color-blue-dark);
132
- }
133
- &.pkt-alert .pkt-alert__close {
134
- --fg-color: var(--color-blue-dark);
135
- }
93
+ &__close {
94
+ --fg-color: var(--pkt-alert-close-fg);
95
+ position: absolute;
96
+ right: 1.125rem;
97
+ top: 0.625rem;
136
98
  }
137
99
  }
@@ -27,57 +27,3 @@
27
27
  width: 4rem;
28
28
  }
29
29
  }
30
-
31
- .pkt-font-icon {
32
- display: inline-block;
33
- font-size: map.get(variables.$font-size, 'large');
34
- font-family: #{map.get(variables.$font-family, 'icon')};
35
-
36
- &--chevron-left::before {
37
- content: '\E907';
38
- }
39
-
40
- &--chevron-right::before {
41
- content: '\E908';
42
- }
43
-
44
- &--chevron-up::before {
45
- content: '\E909';
46
- }
47
-
48
- &--chevron-down::before {
49
- content: '\E906';
50
- }
51
-
52
- &--user::before {
53
- content: '\E921';
54
- }
55
-
56
- &--menu::before {
57
- content: '\E917';
58
- }
59
-
60
- &--close::before {
61
- content: '\E923';
62
- }
63
-
64
- &--search::before {
65
- content: '\E915';
66
- }
67
-
68
- &--trash::before {
69
- content: '\E92D';
70
- }
71
-
72
- &--edit::before {
73
- content: '\E949';
74
- }
75
-
76
- &--filter::before {
77
- content: '\E910';
78
- }
79
-
80
- &--envelope::before {
81
- content: '\E929';
82
- }
83
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-css",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
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",
@@ -21,7 +21,7 @@
21
21
  "watch": "chokidar \"src/scss/**/*\" -c \"npm run build\""
22
22
  },
23
23
  "devDependencies": {
24
- "@oslokommune/punkt-assets": "^2.0.1",
24
+ "@oslokommune/punkt-assets": "^2.0.4",
25
25
  "astro": "^2.0.2",
26
26
  "chokidar-cli": "^3.0.0",
27
27
  "edit-json-file": "^1.7.0",
@@ -57,5 +57,5 @@
57
57
  "url": "https://github.com/oslokommune/punkt/issues"
58
58
  },
59
59
  "license": "MIT",
60
- "gitHead": "fd6b9eca772920f7333e212c6f3f1a54410f248d"
60
+ "gitHead": "035f27105ef83f6e175d996e4cd4e09d85fd9a7e"
61
61
  }