@sb1/ffe-cards 13.0.0 → 14.0.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.
@@ -1,48 +1,6 @@
1
1
  .ffe-card-base {
2
- &:extend(.ffe-body-text);
2
+ .common-card-styling();
3
3
 
4
- background: @ffe-farge-hvit;
5
- box-shadow: 0 1px 4px 0 rgba(38, 38, 38, 0.3);
6
4
  display: block;
7
- margin: 0 0 @ffe-spacing-xs;
8
5
  padding: 0;
9
- border: 2px solid transparent;
10
- border-radius: 5px;
11
- transition: border-color 0.2s;
12
- outline: none;
13
- cursor: pointer;
14
- width: 100%;
15
- text-decoration: none;
16
- .native & {
17
- @media (prefers-color-scheme: dark) {
18
- box-shadow: 0 0 0 1px @ffe-farge-moerkgraa;
19
- background: @ffe-farge-svart;
20
- color: @ffe-farge-hvit;
21
- }
22
- }
23
-
24
- &:focus {
25
- box-shadow: 0 0 0 2px @ffe-farge-vann;
26
-
27
- .native & {
28
- @media (prefers-color-scheme: dark) {
29
- box-shadow: 0 0 0 2px @ffe-farge-vann-70;
30
- }
31
- }
32
- }
33
-
34
- &:focus,
35
- &:active,
36
- &:hover {
37
- border-color: @ffe-farge-vann;
38
- .native & {
39
- @media (prefers-color-scheme: dark) {
40
- border-color: @ffe-farge-vann-70;
41
- }
42
- }
43
- }
44
-
45
- @media (min-width: @breakpoint-md) {
46
- margin-bottom: @ffe-spacing-md;
47
- }
48
6
  }
package/less/cards.less CHANGED
@@ -1,3 +1,4 @@
1
+ @import 'common-card-styling';
1
2
  @import 'card-base';
2
3
  @import 'components';
3
4
  @import 'text-card';
@@ -0,0 +1,46 @@
1
+ .common-card-styling() {
2
+ &:extend(.ffe-body-text);
3
+
4
+ background: @ffe-farge-hvit;
5
+ box-shadow: 0 1px 4px 0 rgba(38, 38, 38, 0.3);
6
+ margin: 0 0 @ffe-spacing-xs;
7
+ border: 2px solid transparent;
8
+ border-radius: 5px;
9
+ transition: border-color 0.2s;
10
+ outline: none;
11
+ cursor: pointer;
12
+ width: 100%;
13
+ text-decoration: none;
14
+ .native & {
15
+ @media (prefers-color-scheme: dark) {
16
+ box-shadow: 0 0 0 1px @ffe-farge-moerkgraa;
17
+ background: @ffe-farge-svart;
18
+ color: @ffe-farge-hvit;
19
+ }
20
+ }
21
+
22
+ &:focus {
23
+ box-shadow: 0 0 0 2px @ffe-farge-vann;
24
+
25
+ .native & {
26
+ @media (prefers-color-scheme: dark) {
27
+ box-shadow: 0 0 0 2px @ffe-farge-vann-70;
28
+ }
29
+ }
30
+ }
31
+
32
+ &:focus,
33
+ &:active,
34
+ &:hover {
35
+ border-color: @ffe-farge-vann;
36
+ .native & {
37
+ @media (prefers-color-scheme: dark) {
38
+ border-color: @ffe-farge-vann-70;
39
+ }
40
+ }
41
+ }
42
+
43
+ @media (min-width: @breakpoint-md) {
44
+ margin-bottom: @ffe-spacing-md;
45
+ }
46
+ }
@@ -1,13 +1,13 @@
1
- .ffe-card-component {
2
- &--card-name {
1
+ .ffe-card-body {
2
+ &__card-name {
3
3
  margin: 0 0 @ffe-spacing-2xs 0;
4
4
  }
5
5
 
6
- &--text {
6
+ &__text {
7
7
  margin: @ffe-spacing-2xs 0 0 0;
8
8
  }
9
9
 
10
- &--subtext {
10
+ &__subtext {
11
11
  &:extend(.ffe-small-text);
12
12
 
13
13
  color: @ffe-farge-moerkgraa;
@@ -20,13 +20,8 @@
20
20
  margin: @ffe-spacing-2xs 0 0 0;
21
21
  }
22
22
 
23
- &--title {
23
+ &__title {
24
24
  &:extend(.ffe-h5);
25
- .native & {
26
- @media (prefers-color-scheme: dark) {
27
- color: @ffe-farge-vann-70;
28
- }
29
- }
30
25
 
31
26
  margin: 0;
32
27
 
@@ -1,8 +1,10 @@
1
1
  .ffe-icon-card {
2
+ .common-card-styling();
3
+
4
+ display: flex;
5
+ padding: @ffe-spacing-md;
2
6
  max-width: 440px;
3
7
  min-height: 130px;
4
- padding: @ffe-spacing-md;
5
- display: flex;
6
8
  flex-flow: row nowrap;
7
9
 
8
10
  &__icon {
@@ -52,11 +54,7 @@
52
54
  margin: 0 @ffe-spacing-sm 0 0;
53
55
  }
54
56
 
55
- .ffe-icon-component--card-name {
56
- margin: 0 0 @ffe-spacing-2xs;
57
- }
58
-
59
- .ffe-icon-component--subtext {
57
+ .ffe-card-body__subtext {
60
58
  margin: 0;
61
59
 
62
60
  @media (min-width: @breakpoint-md) {
@@ -75,7 +73,7 @@
75
73
  }
76
74
  }
77
75
 
78
- .ffe-card-component--title,
76
+ .ffe-card-body__title,
79
77
  .ffe-icon-card__body {
80
78
  color: @ffe-farge-moerkgraa;
81
79
  .native & {
@@ -1,20 +1,22 @@
1
1
  .ffe-image-card {
2
- max-width: 290px;
2
+ .common-card-styling();
3
+
4
+ display: flex;
3
5
  padding: 0;
6
+ max-width: 290px;
4
7
  border: 0;
5
- display: flex;
6
8
  flex-flow: column nowrap;
7
9
 
8
10
  &:focus,
9
11
  &:active,
10
12
  &:hover {
11
- .ffe-image-card__image__overlay,
13
+ .ffe-image-card__image-overlay,
12
14
  .ffe-image-card__body {
13
15
  border-color: @ffe-farge-vann;
14
16
  }
15
17
  }
16
18
 
17
- &__image {
19
+ &__image-container {
18
20
  max-height: 160px;
19
21
  position: relative;
20
22
  overflow: hidden;
@@ -22,7 +24,11 @@
22
24
  border-top-right-radius: 5px;
23
25
  }
24
26
 
25
- &__image__overlay,
27
+ &__image {
28
+ max-width: 100%;
29
+ }
30
+
31
+ &__image-overlay,
26
32
  &__body {
27
33
  width: 100%;
28
34
  overflow: hidden;
@@ -30,7 +36,7 @@
30
36
  transition: border-color @ffe-transition-duration;
31
37
  }
32
38
 
33
- &__image__overlay {
39
+ &__image-overlay {
34
40
  z-index: 10;
35
41
  height: 100%;
36
42
  border-bottom: 0;
@@ -1,6 +1,8 @@
1
1
  .ffe-text-card {
2
- padding: @ffe-spacing-sm @ffe-spacing-lg;
2
+ .common-card-styling();
3
+
3
4
  display: flex;
5
+ padding: @ffe-spacing-sm @ffe-spacing-lg;
4
6
  flex-flow: column nowrap;
5
7
  text-align: center;
6
8
  overflow: hidden;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-cards",
3
- "version": "13.0.0",
3
+ "version": "14.0.0",
4
4
  "description": "Kort for bruk i oversikter",
5
5
  "license": "MIT",
6
6
  "author": "SpareBank 1",
@@ -24,5 +24,5 @@
24
24
  "publishConfig": {
25
25
  "access": "public"
26
26
  },
27
- "gitHead": "0ff2b9371adf4b9fda3acbe2ec821d43f2105877"
27
+ "gitHead": "95b3ff2900ad28f5f85034ebc88743f366e64c31"
28
28
  }