@oslokommune/punkt-css 11.10.0 → 11.11.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.
@@ -6,7 +6,7 @@
6
6
  @forward 'spacing';
7
7
 
8
8
  // Default icon path
9
- $icon-path: 'https://punkt-cdn.oslo.kommune.no/11.10/icons' !default;
9
+ $icon-path: 'https://punkt-cdn.oslo.kommune.no/11.11/icons' !default;
10
10
 
11
11
  // Borders
12
12
  $border-width: (
@@ -0,0 +1,169 @@
1
+ /*
2
+ * Accordion/Expandable component
3
+ */
4
+
5
+ @use 'sass:map';
6
+ @use '../abstracts/variables';
7
+ @use '../abstracts/mixins/breakpoints' as *;
8
+ @use '../abstracts/' as *;
9
+
10
+ .pkt-accordion {
11
+ display: grid;
12
+ grid-template-columns: 1fr;
13
+ grid-template-rows: 0fr;
14
+ row-gap: map.get(variables.$spacing, 'size-8');
15
+ transition: grid-template-rows 500ms;
16
+
17
+ font-size: map.get(variables.$font-size, 'size-24');
18
+ font-weight: map.get(variables.$font-weight, 'medium');
19
+ letter-spacing: map.get(variables.$letter-spacing, 'tight');
20
+ line-height: map.get(variables.$line-height, 'lh-36');
21
+
22
+ &:focus-visible {
23
+ border: 0.25rem solid var(--pkt-color-border-states-hover);
24
+ }
25
+ }
26
+
27
+ // Skin variations
28
+ .pkt-accordion--borderless {
29
+ .pkt-accordion-item {
30
+ border: none;
31
+
32
+ &[open] {
33
+ .pkt-accordion-item__title {
34
+ box-shadow: inset 0 0 0 0.25rem var(--pkt-color-border-states-active);
35
+ }
36
+ }
37
+ }
38
+ }
39
+
40
+ .pkt-accordion--outlined {
41
+ .pkt-accordion-item {
42
+ border: 3px solid var(--pkt-color-border-gray);
43
+ }
44
+ }
45
+
46
+ .pkt-accordion--beige {
47
+ row-gap: 0;
48
+
49
+ .pkt-accordion-item {
50
+ &:nth-child(odd) {
51
+ background-color: var(--pkt-color-surface-default-light-beige);
52
+ }
53
+ }
54
+ }
55
+
56
+ .pkt-accordion--blue {
57
+ row-gap: 0;
58
+
59
+ .pkt-accordion-item {
60
+ &:nth-child(odd) {
61
+ background-color: var(--pkt-color-surface-default-light-blue);
62
+ }
63
+ }
64
+ }
65
+
66
+ // COMPACT
67
+
68
+ .pkt-accordion--compact.pkt-accordion--borderless {
69
+ .pkt-accordion-item {
70
+ border: none;
71
+
72
+ &--open {
73
+ .pkt-accordion-item__title {
74
+ box-shadow: inset 0 0 0 0.125rem var(--pkt-color-border-states-active);
75
+ }
76
+ }
77
+ }
78
+ }
79
+ .pkt-accordion--compact > .pkt-accordion-item {
80
+ .pkt-accordion-item {
81
+ &__title {
82
+ padding: map.get(variables.$spacing, 'size-16');
83
+ font-size: map.get(variables.$font-size, 'size-16');
84
+ font-weight: map.get(variables.$font-weight, 'medium');
85
+ letter-spacing: map.get(variables.$letter-spacing, 'tight');
86
+ line-height: map.get(variables.$line-height, 'lh-24');
87
+ }
88
+
89
+ &__content {
90
+ padding: map.get(variables.$spacing, 'size-16');
91
+ font-size: map.get(variables.$font-size, 'size-16');
92
+ font-weight: map.get(variables.$font-weight, 'light');
93
+ letter-spacing: map.get(variables.$letter-spacing, 'tight');
94
+ line-height: map.get(variables.$line-height, 'lh-24');
95
+ }
96
+ }
97
+ }
98
+
99
+ // Accordion item
100
+ .pkt-accordion-item {
101
+ color: var(--pkt-color-brand-dark-blue-1000);
102
+ background-color: var(--pkt-color-brand-neutrals-white);
103
+ transition: transform 0.3s;
104
+ appearance: none;
105
+ text-align: left;
106
+
107
+ summary::-webkit-details-marker {
108
+ display: none;
109
+ }
110
+
111
+ &__title {
112
+ align-items: center;
113
+ cursor: pointer;
114
+ display: flex;
115
+ justify-content: space-between;
116
+ padding: map.get(variables.$spacing, 'size-24');
117
+
118
+ &:hover {
119
+ text-decoration: underline;
120
+
121
+ .pkt-accordion-item__icon {
122
+ transform: translateY(0.25rem);
123
+ }
124
+ }
125
+
126
+ &:focus-visible {
127
+ outline: 0.25rem solid var(--pkt-color-border-states-focus);
128
+ }
129
+ }
130
+
131
+ &__icon {
132
+ transition: transform 0.2s;
133
+ }
134
+
135
+ &__content {
136
+ border-top: none;
137
+ display: none;
138
+ font-size: map.get(variables.$font-size, 'size-18');
139
+ font-weight: map.get(variables.$font-weight, 'light');
140
+ letter-spacing: map.get(variables.$letter-spacing, 'tight');
141
+ line-height: map.get(variables.$line-height, 'lh-28');
142
+ padding: map.get(variables.$spacing, 'size-24');
143
+ }
144
+ }
145
+
146
+ // Accordion item when opened
147
+ .pkt-accordion-item[open] {
148
+ .pkt-accordion-item__title {
149
+ border-bottom: none;
150
+ &:hover {
151
+ .pkt-accordion-item__icon {
152
+ transform: rotate(180deg) translateY(0.25rem);
153
+ }
154
+ }
155
+ }
156
+
157
+ .pkt-accordion-item__content {
158
+ display: block;
159
+ }
160
+
161
+ .pkt-accordion-item__icon {
162
+ transform: rotate(180deg) translateY(0);
163
+ }
164
+ }
165
+
166
+ .pkt-icon.pkt-accordion-item__icon > svg {
167
+ min-height: 2rem;
168
+ min-width: 2rem;
169
+ }
@@ -1,4 +1,4 @@
1
- /*
1
+ /*
2
2
  * Alert component
3
3
  */
4
4
  @use 'sass:map';
@@ -36,49 +36,6 @@ $-border-thickness: map.get(variables.$spacing, 'size-4');
36
36
  --pkt-color-alert-bg: var(--pkt-color-surface-default-yellow);
37
37
  }
38
38
 
39
- // Påskemodus
40
- // Kode: PÅSKEFIGUR
41
- .#{$-module-name}--🐣 {
42
- --pkt-color-alert-bc: var(--pkt-color-border-yellow);
43
- --pkt-color-alert-bg: white;
44
- --angle: 0deg;
45
- border: $-border-thickness solid var(--pkt-color-alert-bc);
46
- border-image: conic-gradient(from var(--angle), red, yellow, lime, aqua, blue, magenta, red) 1;
47
- animation: 1s 🐣 linear infinite;
48
- .#{$-module-name}__icon {
49
- animation: 0.5s 🐰 linear infinite;
50
- font-size: 2rem;
51
- }
52
- &.#{$-module-name}--compact .#{$-module-name}__icon {
53
- font-size: 1.5rem;
54
- }
55
- }
56
-
57
- @keyframes 🐣 {
58
- to {
59
- --angle: 360deg;
60
- }
61
- }
62
-
63
- @keyframes 🐰 {
64
- 0% {
65
- transform: rotate(0deg);
66
- }
67
- 25% {
68
- transform: rotate(10deg);
69
- }
70
- 50% {
71
- transform: rotate(0eg);
72
- }
73
- 75% {
74
- transform: rotate(-10deg);
75
- }
76
- 100% {
77
- transform: rotate(0deg);
78
- }
79
- }
80
- // Slutt på påskemodus
81
-
82
39
  @property --angle {
83
40
  syntax: '<angle>';
84
41
  initial-value: 0deg;
@@ -1,3 +1,4 @@
1
+ @forward 'accordion';
1
2
  @forward 'alert';
2
3
  @forward 'tag';
3
4
  @forward 'backlink';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-css",
3
- "version": "11.10.0",
3
+ "version": "11.11.0",
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",
@@ -55,5 +55,5 @@
55
55
  "url": "https://github.com/oslokommune/punkt/issues"
56
56
  },
57
57
  "license": "MIT",
58
- "gitHead": "fdad728821188991ca5ecafbc17313e7a7f2cbb7"
58
+ "gitHead": "91201c4a7cd0684df65f421b9868bd02c22a2ecf"
59
59
  }