@bonniernews/dn-design-system-web 8.2.0 → 8.3.1

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 8.3.1 (2023-11-14)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **web:** scaling fonts ([#1093](https://github.com/BonnierNews/dn-design-system/issues/1093)) ([052af34](https://github.com/BonnierNews/dn-design-system/commit/052af346dc203148f9995ec79c59462880f045ee))
12
+
13
+
14
+
15
+ ## 8.3.0 (2023-11-14)
16
+
17
+
18
+ ### Features
19
+
20
+ * **web:** add typography manual helper ([#1094](https://github.com/BonnierNews/dn-design-system/issues/1094)) ([8bd836f](https://github.com/BonnierNews/dn-design-system/commit/8bd836f19ec415af70cd878e855b001bce47c142))
21
+
22
+
23
+
6
24
  ## 8.2.0 (2023-11-14)
7
25
 
8
26
 
@@ -59,16 +59,14 @@
59
59
  size: "small",
60
60
  iconName: "arrow_back",
61
61
  classNames: "ds-group-header__arrow ds-group-header__arrow--left",
62
- attributes: {"aria-label": "Föregående"},
63
- forcePx: true
62
+ attributes: {"aria-label": "Föregående"}
64
63
  }) }}
65
64
  {{ IconButton({
66
65
  variant: "elevated",
67
66
  size: "small",
68
67
  iconName: "arrow_forward",
69
68
  classNames: "ds-group-header__arrow ds-group-header__arrow--right",
70
- attributes: {"aria-label": "Nästa"},
71
- forcePx: true
69
+ attributes: {"aria-label": "Nästa"}
72
70
  }) }}
73
71
  </div>
74
72
  {% endif %}
@@ -53,8 +53,8 @@
53
53
  }
54
54
 
55
55
  .ds-group-header__icon {
56
- height: 24px;
57
- width: 24px;
56
+ height: ds-px-to-rem(24px);
57
+ width: ds-px-to-rem(24px);
58
58
  color: var(--group-header-icon-color);
59
59
  }
60
60
 
@@ -12,7 +12,7 @@
12
12
  padding: ds-spacing($ds-s-025 $ds-s-050);
13
13
  margin-left: ds-spacing($ds-s-050);
14
14
 
15
- @include ds-typography($ds-typography-functional-meta01regular, true);
15
+ @include ds-typography($ds-typography-functional-meta01regular);
16
16
  color: $ds-color-static-white;
17
17
 
18
18
  background-color: $ds-color-static-transparent-black;
@@ -33,15 +33,13 @@
33
33
  {{ params.mediaHtml }}
34
34
  {% if params.isLocked %}
35
35
  {{ VipBadge({
36
- showText: true,
37
- forcePx: true
36
+ showText: true
38
37
  }) }}
39
38
  {% endif %}
40
39
  </div>
41
40
  {% elif params.isItalicHeadline and params.isLocked %}
42
41
  {{ VipBadge({
43
- showText: false,
44
- forcePx: true
42
+ showText: false
45
43
  }) }}
46
44
  {% endif %}
47
45
 
@@ -18,8 +18,7 @@
18
18
  {{ params.mediaHtml }}
19
19
  {% if params.isLocked %}
20
20
  {{ VipBadge({
21
- showText: false,
22
- forcePx: true
21
+ showText: false
23
22
  }) }}
24
23
  {% endif %}
25
24
  {% endif %}
@@ -26,8 +26,7 @@
26
26
  {{ params.mediaHtml }}
27
27
  {% if params.isLocked %}
28
28
  {{ VipBadge({
29
- showText: false,
30
- forcePx: true
29
+ showText: false
31
30
  }) }}
32
31
  {% endif %}
33
32
  </div>
@@ -70,6 +70,10 @@
70
70
  }
71
71
 
72
72
  .ds-teaser__media {
73
+ .ds-teaser-image__byline {
74
+ @include ds-typography($ds-typography-functional-meta01regular, true);
75
+ }
76
+
73
77
  @include ds-mq-largest-breakpoint(mobile) {
74
78
  margin-bottom: ds-spacing($ds-s-050);
75
79
 
@@ -25,8 +25,7 @@
25
25
 
26
26
  {% if params.isLocked and not params.mediaHtml and params.isItalicHeadline %}
27
27
  {{ VipBadge({
28
- showText: false,
29
- forcePx: true
28
+ showText: false
30
29
  }) }}
31
30
  {% endif %}
32
31
 
@@ -36,8 +35,7 @@
36
35
  {{ params.mediaHtml }}
37
36
  {% if params.isLocked %}
38
37
  {{ VipBadge({
39
- showText: false,
40
- forcePx: true
38
+ showText: false
41
39
  }) }}
42
40
  {% endif %}
43
41
  </div>
@@ -34,6 +34,10 @@
34
34
  margin-left: ds-spacing($ds-s-100);
35
35
  float: right;
36
36
 
37
+ .ds-teaser-image__byline {
38
+ @include ds-typography($ds-typography-functional-meta01regular, true);
39
+ }
40
+
37
41
  @include ds-mq-only-breakpoint(mobile) {
38
42
  min-width: $ds-teaser-standard-image-width-mobile;
39
43
  max-width: $ds-teaser-standard-image-width-mobile;
@@ -98,6 +98,30 @@ $dsSerifWeights: (
98
98
  }
99
99
  }
100
100
 
101
+ @mixin ds-typography-manual(
102
+ $family,
103
+ $size,
104
+ $lineHeight: $size * 1.2,
105
+ $weight: 400,
106
+ $fontStyle: "",
107
+ $letterSpacing: "",
108
+ $scaling: "small"
109
+ ) {
110
+ $dsTypographyKeys: (
111
+ fontFamily: $family,
112
+ fontSize: $size,
113
+ lineHeight: $lineHeight,
114
+ // numbers and strings are both handled as strings in fontWeight
115
+ fontWeight: "#{$weight}",
116
+ fontStyle: $fontStyle,
117
+ letterSpacing: $letterSpacing,
118
+ );
119
+ $forcePx: $scaling == false;
120
+ @each $key in map-keys($dsTypographyKeys) {
121
+ @include _ds-typography-get-property($dsTypographyKeys, $key, $forcePx, $scaling);
122
+ }
123
+ }
124
+
101
125
  @mixin _ds-typography-get-property($map, $key, $forcePx, $screen: "small") {
102
126
  $unit: "";
103
127
  $value: map.get($map, $key);
@@ -4,6 +4,8 @@
4
4
 
5
5
  # Typography
6
6
 
7
+ ## Typography token
8
+
7
9
  |parameter | type | required | options | default | description |
8
10
  |:--- | :--- | :--- | :--- | :--- | :--- |
9
11
  |token | Sass variable | yes | | | Ex. $ds-typography-functional-body01regular, all typography variables starts with prefix $ds-typography- |
@@ -13,7 +15,7 @@ These are copy paste friendly examples to quickliy get started using a component
13
15
 
14
16
  ### SCSS
15
17
  ```scss
16
- @use "@bonniernews/dn-design-system-web/foundations/helpers/typography" as *;
18
+ @use "@bonniernews/dn-design-system-web/foundations/helpers/forward.helpers" as *;
17
19
 
18
20
  @include ds-typography($ds-typography-functional-body01regular);
19
21
  ```
@@ -22,3 +24,24 @@ With forcePX parameter:
22
24
  ```scss
23
25
  @include ds-typography($ds-typography-functional-body01regular, true);
24
26
  ```
27
+
28
+ ## ⚠️ Manual typography (only for use in special circumstances)
29
+
30
+ |parameter | type | required | options | default | description |
31
+ |:--- | :--- | :--- | :--- | :--- | :--- |
32
+ |family | String | yes | Sans, Serif | | DN Font family |
33
+ |size | Number | yes | | | Font size in px without unit |
34
+ |lineHeight | Number | no | | size * 1.2 | Line height in px without unit |
35
+ |weight | String, Number | no | bold, 400, etc | 400 | Font weight accepts both name or number |
36
+ |fontStyle | String | no | | | Font style, ex Italic |
37
+ |letterSpacing | Number | no | | font default | Letter spacing |
38
+ |scaling | String, Bool | no | "small", "large", "extraLarge" or false | "small" | Applies typography scaling for screen size. If set to false font will not scale. |
39
+
40
+ These are copy paste friendly examples to quickliy get started using a component.
41
+
42
+ ### SCSS
43
+ ```scss
44
+ @use "@bonniernews/dn-design-system-web/foundations/helpers/forward.helpers" as *;
45
+
46
+ @include ds-typography-manual('Sans', 36, 48, bold);
47
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "8.2.0",
3
+ "version": "8.3.1",
4
4
  "description": "DN design system for web.",
5
5
  "main": "index.js",
6
6
  "homepage": "https://github.com/BonnierNews/dn-design-system/tree/main/web/src#readme",