@bonniernews/dn-design-system-web 8.1.1 → 8.3.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.
- package/CHANGELOG.md +18 -0
- package/assets/teaser/teaser.scss +11 -0
- package/components/teaser-large/README.md +1 -0
- package/components/teaser-large/teaser-large.njk +3 -0
- package/components/teaser-standard/README.md +1 -0
- package/components/teaser-standard/teaser-standard.njk +3 -0
- package/foundations/helpers/typography.scss +24 -0
- package/foundations/typography/README.md +24 -1
- package/package.json +1 -1
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.0 (2023-11-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **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))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## 8.2.0 (2023-11-14)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **web:** add timestamps to TeaserStandard and TeaserLarge ([#1087](https://github.com/BonnierNews/dn-design-system/issues/1087)) ([0e90215](https://github.com/BonnierNews/dn-design-system/commit/0e90215a5e12f1be299e8eabb6d9a19bcb42c374))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## 8.1.1 (2023-11-14)
|
|
7
25
|
|
|
8
26
|
|
|
@@ -68,6 +68,17 @@ $grade-size: ds-px-to-rem(34px);
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
.ds-teaser__publication-time {
|
|
72
|
+
display: block;
|
|
73
|
+
@include ds-typography($ds-typography-functional-meta02regular);
|
|
74
|
+
color: $ds-color-text-primary-02;
|
|
75
|
+
margin-top: ds-spacing($ds-s-050);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.ds-teaser__text + .ds-teaser__publication-time {
|
|
79
|
+
margin-top: ds-spacing($ds-s-075);
|
|
80
|
+
}
|
|
81
|
+
|
|
71
82
|
.ds-icon.ds-icon--grade {
|
|
72
83
|
color: $ds-color-icon-primary;
|
|
73
84
|
border-radius: 50%;
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
|isLargeHeadline | bool | no | true, false | false | If the headline should be large. Only has an effect if `isItalicHeadline` is true. |
|
|
27
27
|
|isFlashingDot | bool | no | true, false | false | If there should be a flashing ball before the text |
|
|
28
28
|
|isLocked | bool | no | true, false | false | If the paywall indicator should be shown. It is only shown if the teaser has an image. |
|
|
29
|
+
|publicationTime | string | no | | null | Publication time text. |
|
|
29
30
|
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
30
31
|
|classNames | String | no | | | Ex. "my-special-class" |
|
|
31
32
|
|~forcePx~ | | | | | Not supported |
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
|isItalicHeadline | bool | no | true, false | false | If the headline should be italic |
|
|
25
25
|
|isFlashingDot | bool | no | true, false | false | If there should be a flashing ball before the text |
|
|
26
26
|
|isLocked | bool | no | true, false | false | If the paywall indicator should be shown. It is only shown if the teaser has an image. |
|
|
27
|
+
|publicationTime | string | no | | null | Publication time text. |
|
|
27
28
|
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
28
29
|
|classNames | String | no | | | Ex. "my-special-class" |
|
|
29
30
|
|~forcePx~ | | | | | Not supported |
|
|
@@ -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/
|
|
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