@sb1/ffe-accordion 8.1.4 → 8.2.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.
@@ -0,0 +1,104 @@
1
+ .ffe-accordion {
2
+ width: 100%;
3
+ border: 1px solid transparent;
4
+ font-family: var(--ffe-g-font);
5
+ }
6
+
7
+ .ffe-accordion-item {
8
+ margin-bottom: @ffe-spacing-xs;
9
+ transition: margin-bottom @ffe-transition-duration @ffe-ease-in-out-back;
10
+ box-shadow: 0 1px 4px rgb(38 38 38 / 30%);
11
+ border-radius: 16px;
12
+ border: 2px solid transparent;
13
+ background-color: var(--ffe-v-accordion-secondary-color);
14
+
15
+ &__heading {
16
+ margin: 0;
17
+ }
18
+
19
+ &__heading-button {
20
+ width: 100%;
21
+ background: none;
22
+ border: none;
23
+ padding: @ffe-spacing-sm;
24
+ font-family: var(--ffe-g-font-heading-small);
25
+ cursor: pointer;
26
+ outline: none;
27
+ color: var(--ffe-v-accordion-primary-color);
28
+
29
+ &:hover {
30
+ .ffe-accordion-item__heading-icon {
31
+ transition: fill @ffe-transition-duration @ffe-ease;
32
+ fill: var(--ffe-v-accordion-secondary-color);
33
+ }
34
+
35
+ .ffe-accordion-item__heading-icon-wrapper {
36
+ transition: background-color @ffe-transition-duration @ffe-ease;
37
+ background-color: var(--ffe-v-accordion-primary-color);
38
+ }
39
+ }
40
+
41
+ &:focus-visible {
42
+ outline: none;
43
+ }
44
+ }
45
+
46
+ &__heading-button-content {
47
+ text-align: start;
48
+ width: 100%;
49
+ display: flex;
50
+ align-items: center;
51
+ justify-content: space-between;
52
+ gap: @ffe-spacing-xs;
53
+ }
54
+
55
+ &__heading-icon-wrapper {
56
+ line-height: 0;
57
+ border: 1px solid var(--ffe-v-accordion-primary-color);
58
+ border-radius: 50%;
59
+ padding: 11px;
60
+ }
61
+
62
+ &__heading-icon {
63
+ flex: 0 0 auto;
64
+ fill: var(--ffe-v-accordion-primary-color);
65
+ width: 11px;
66
+ height: 11px;
67
+ transition: transform @ffe-transition-duration @ffe-ease-in-out-back;
68
+ }
69
+
70
+ &__body {
71
+ padding: @ffe-spacing-xs @ffe-spacing-sm @ffe-spacing-md;
72
+ color: var(--ffe-v-accordion-body-text-color);
73
+ }
74
+
75
+ &--open {
76
+ &:not(:last-of-type) {
77
+ margin-bottom: @ffe-spacing-md;
78
+ }
79
+
80
+ .ffe-accordion-item__heading-icon {
81
+ transform: rotateZ(180deg);
82
+ }
83
+ }
84
+
85
+ &--focus {
86
+ border-color: var(--ffe-v-accordion-focus-border-color);
87
+ }
88
+ }
89
+
90
+ .native & {
91
+ @media (prefers-color-scheme: dark) {
92
+ .ffe-accordion-item {
93
+ &:hover {
94
+ .ffe-accordion-item__heading-icon {
95
+ fill: var(--ffe-v-accordion-secondary-color);
96
+ }
97
+
98
+ .ffe-accordion-item__heading-icon-wrapper {
99
+ background-color: var(--ffe-v-accordion-primary-color);
100
+ }
101
+ }
102
+ }
103
+ }
104
+ }
@@ -1,124 +1,2 @@
1
- .ffe-accordion {
2
- width: 100%;
3
- border: 1px solid transparent;
4
- font-family: 'SpareBank1-regular', 'MuseoSans-500', arial, sans-serif;
5
- }
6
-
7
- .ffe-accordion-item {
8
- margin-bottom: @ffe-spacing-xs;
9
- transition: margin-bottom @ffe-transition-duration @ffe-ease-in-out-back;
10
- box-shadow: 0 1px 4px rgb(38 38 38 / 30%);
11
- border-radius: 16px;
12
- border: 2px solid transparent;
13
- background-color: @ffe-farge-hvit;
14
-
15
- &__heading {
16
- margin: 0;
17
- }
18
-
19
- &__heading-button {
20
- width: 100%;
21
- background: none;
22
- border: none;
23
- padding: @ffe-spacing-sm;
24
- font-family: 'SpareBank1-medium', 'MuseoSansRounded-700', arial,
25
- sans-serif;
26
- cursor: pointer;
27
- outline: none;
28
- color: @ffe-farge-vann;
29
-
30
- &:hover {
31
- .ffe-accordion-item__heading-icon {
32
- transition: fill @ffe-transition-duration @ffe-ease;
33
- fill: @ffe-farge-hvit;
34
- }
35
-
36
- .ffe-accordion-item__heading-icon-wrapper {
37
- transition: background-color @ffe-transition-duration @ffe-ease;
38
- background-color: @ffe-farge-vann;
39
- }
40
- }
41
-
42
- &:focus-visible {
43
- outline: none;
44
- }
45
- }
46
-
47
- &__heading-button-content {
48
- text-align: start;
49
- width: 100%;
50
- display: flex;
51
- align-items: center;
52
- justify-content: space-between;
53
- }
54
-
55
- &__heading-icon-wrapper {
56
- line-height: 0;
57
- border: 1px solid @ffe-farge-vann;
58
- border-radius: 50%;
59
- padding: 11px;
60
- }
61
-
62
- &__heading-icon {
63
- flex: 0 0 auto;
64
- fill: @ffe-farge-vann;
65
- width: 11px;
66
- height: 11px;
67
- transition: transform @ffe-transition-duration @ffe-ease-in-out-back;
68
- }
69
-
70
- &__body {
71
- padding: @ffe-spacing-xs @ffe-spacing-sm @ffe-spacing-md;
72
- color: @ffe-farge-svart;
73
- }
74
-
75
- &--open {
76
- &:not(:last-of-type) {
77
- margin-bottom: @ffe-spacing-md;
78
- }
79
-
80
- .ffe-accordion-item__heading-icon {
81
- transform: rotateZ(180deg);
82
- }
83
- }
84
-
85
- &--focus {
86
- border-color: @ffe-farge-vann;
87
- }
88
- }
89
-
90
- .native & {
91
- @media (prefers-color-scheme: dark) {
92
- .ffe-accordion-item {
93
- background-color: @ffe-farge-natt;
94
-
95
- &__heading-button {
96
- color: @ffe-farge-frost;
97
- }
98
-
99
- &__body {
100
- color: @ffe-farge-hvit;
101
- }
102
-
103
- .ffe-accordion-item__heading-icon {
104
- fill: @ffe-farge-frost;
105
- }
106
-
107
- .ffe-accordion-item__heading-icon-wrapper {
108
- border-color: @ffe-farge-frost;
109
- }
110
-
111
- &:hover {
112
- border-color: @ffe-farge-hvit;
113
-
114
- .ffe-accordion-item__heading-icon {
115
- fill: @ffe-farge-frost;
116
- }
117
-
118
- .ffe-accordion-item__heading-icon-wrapper {
119
- background-color: transparent;
120
- }
121
- }
122
- }
123
- }
124
- }
1
+ @import 'theme';
2
+ @import 'accordion';
@@ -0,0 +1,15 @@
1
+ :root {
2
+ --ffe-v-accordion-primary-color: var(--ffe-farge-vann);
3
+ --ffe-v-accordion-secondary-color: var(--ffe-farge-hvit);
4
+ --ffe-v-accordion-body-text-color: var(--ffe-farge-svart);
5
+ --ffe-v-accordion-focus-border-color: var(--ffe-farge-vann);
6
+
7
+ @media (prefers-color-scheme: dark) {
8
+ .native {
9
+ --ffe-v-accordion-primary-color: var(--ffe-farge-frost);
10
+ --ffe-v-accordion-secondary-color: var(--ffe-farge-natt);
11
+ --ffe-v-accordion-body-text-color: var(--ffe-farge-hvit);
12
+ --ffe-v-accordion-focus-border-color: var(--ffe-farge-hvit);
13
+ }
14
+ }
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-accordion",
3
- "version": "8.1.4",
3
+ "version": "8.2.0",
4
4
  "description": "Accordion component for FFE.",
5
5
  "license": "MIT",
6
6
  "author": "SpareBank 1",
@@ -25,5 +25,5 @@
25
25
  "publishConfig": {
26
26
  "access": "public"
27
27
  },
28
- "gitHead": "23cb4cbf5dc0c3f41c1c33d3e46155558a85b9df"
28
+ "gitHead": "a4c974536f61a9005b17d159ea53c20d0d3f71a9"
29
29
  }