@bonniernews/dn-design-system-web 8.0.10 → 8.1.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 +18 -0
- package/assets/teaser/teaser.scss +4 -0
- package/components/footer/footer.scss +2 -0
- package/components/group-header/group-header.scss +1 -1
- package/components/teaser-list-swipe/teaser-list-swipe.scss +1 -1
- package/components/teaser-list-vertical/README.md +1 -1
- package/components/teaser-list-vertical/teaser-list-vertical.njk +14 -6
- package/components/teaser-list-vertical/teaser-list-vertical.scss +22 -0
- package/components/teaser-longlife/teaser-longlife.scss +9 -1
- package/components/teaser-native/teaser-native.scss +8 -0
- package/components/teaser-swipe-card/teaser-swipe-card.scss +1 -1
- package/foundations/helpers/hover.scss +17 -7
- 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.1.1 (2023-11-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **web:** improve focus outline ([#1092](https://github.com/BonnierNews/dn-design-system/issues/1092)) ([547ff35](https://github.com/BonnierNews/dn-design-system/commit/547ff3565bc529fa61630e594e1d131cdc87b137))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## 8.1.0 (2023-11-13)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **web:** implement vignette, highlight, and italic headlines on media lists ([#1089](https://github.com/BonnierNews/dn-design-system/issues/1089)) ([5ffb9c4](https://github.com/BonnierNews/dn-design-system/commit/5ffb9c4ef06afc9880b802e010faa25fcd984bdd))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## 8.0.10 (2023-11-10)
|
|
7
25
|
|
|
8
26
|
|
|
@@ -11,6 +11,10 @@ $ds-teaser-standard-image-width-desktop: 196px;
|
|
|
11
11
|
|
|
12
12
|
$grade-size: ds-px-to-rem(34px);
|
|
13
13
|
|
|
14
|
+
@mixin ds-teaser-focus($offset: 2px, $includeSelector: true) {
|
|
15
|
+
@include ds-focus($offset, $includeSelector);
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
.ds-teaser {
|
|
15
19
|
display: block;
|
|
16
20
|
background-color: $ds-color-surface-background;
|
|
@@ -112,6 +112,7 @@ $ds-footer-column-gap: ds-spacing($ds-s-400);
|
|
|
112
112
|
|
|
113
113
|
a {
|
|
114
114
|
@include ds-link($ds-link-list);
|
|
115
|
+
@include ds-focus($offset: 2px, $color: $ds-color-static-white);
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
}
|
|
@@ -126,6 +127,7 @@ $ds-footer-column-gap: ds-spacing($ds-s-400);
|
|
|
126
127
|
|
|
127
128
|
a {
|
|
128
129
|
@include ds-link($ds-link-list);
|
|
130
|
+
@include ds-focus($offset: 2px, $color: $ds-color-static-white);
|
|
129
131
|
margin: ds-spacing($ds-s-100 $ds-s-100 0 0);
|
|
130
132
|
display: inline-block;
|
|
131
133
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
-
|
|
2
|
+
@use "../../assets/teaser/teaser.scss" as *;
|
|
3
3
|
@use "../../components/icon-button/icon-button";
|
|
4
4
|
@use "../../components/group-header/group-header";
|
|
5
5
|
@use "../../components/teaser-swipe-card/teaser-swipe-card";
|
|
@@ -43,7 +43,7 @@ These are copy paste friendly examples to quickliy get started using a component
|
|
|
43
43
|
listTitle: "Senaste klippen",
|
|
44
44
|
listType: "media",
|
|
45
45
|
mediaIcon: "play_arrow-filled",
|
|
46
|
-
teasers: [ { title: 'Svenska hjältehunden Killian arbetar mot klockan i Marocko – är det försent?', targetLink: '#', publicationTime: 'I går 21:22', mediaHtml: '<div class="picture"><img class="picture__img" src="??"></div>', video: 'true', attributes: { "data-test": "list-item-test-data" } } ]
|
|
46
|
+
teasers: [ { title: 'Svenska hjältehunden Killian arbetar mot klockan i Marocko – är det försent?', vignette: "VÄRLDEN", targetLink: '#', isItalicHeadline: false, publicationTime: 'I går 21:22', mediaHtml: '<div class="picture"><img class="picture__img" src="??"></div>', video: 'true', attributes: { "data-test": "list-item-test-data" } } ]
|
|
47
47
|
})}}
|
|
48
48
|
```
|
|
49
49
|
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
|
|
29
29
|
<div class="{{ componentClassName + '__content'}}">
|
|
30
30
|
{% for teaser in params.teasers %}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
{% if isMediaList %}
|
|
32
|
+
{{ TeaserListVerticalMediaItem(teaser) }}
|
|
33
|
+
{% else %}
|
|
34
|
+
{{ TeaserListVerticalItem(teaser) }}
|
|
35
|
+
{% endif %}
|
|
36
36
|
{% endfor %}
|
|
37
37
|
</div>
|
|
38
38
|
{% if showButton %}
|
|
@@ -72,12 +72,20 @@
|
|
|
72
72
|
{% set attributes = getAttributes(teaser.attributes) %}
|
|
73
73
|
{%- set classes = [
|
|
74
74
|
"ds-teaser-list-vertical__media-item",
|
|
75
|
+
"ds-teaser-list-vertical__media-item--italic" if teaser.isItalicHeadline,
|
|
75
76
|
teaser.classNames if teaser.classNames
|
|
76
77
|
] | join(" ") %}
|
|
77
78
|
|
|
78
79
|
<a href="{{teaser.targetLink}}" class="{{ classes }}" {{- attributes | safe }}>
|
|
79
80
|
<div class="ds-teaser-list-vertical__media-item-text">
|
|
80
|
-
|
|
81
|
+
{% if teaser.vignette %}
|
|
82
|
+
<div class="ds-teaser-list-vertical__media-item-vignette">{{ teaser.vignette }}</div>
|
|
83
|
+
{% endif %}
|
|
84
|
+
<h3 class="ds-teaser-list-vertical__media-item-title">
|
|
85
|
+
{%- if teaser.highlight %}
|
|
86
|
+
<span class="ds-teaser-list-vertical__media-item-highlight">{{ teaser.highlight }}</span>
|
|
87
|
+
{% endif %}
|
|
88
|
+
{{- teaser.title }}</h3>
|
|
81
89
|
{% if teaser.publicationTime or teaser.sectionName %}
|
|
82
90
|
<div class="ds-teaser-list-vertical__media-item-notes">
|
|
83
91
|
<span>{{ teaser.publicationTime }}</span>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
2
|
@use "../button/button.scss" as *;
|
|
3
3
|
@use "../../components/group-header/group-header";
|
|
4
|
+
@use "../../assets/teaser/teaser.scss" as *;
|
|
4
5
|
@use "../../components/teaser-dot/teaser-dot.scss";
|
|
5
6
|
|
|
6
7
|
$ds-dot-size: ds-px-to-rem(10px);
|
|
@@ -20,6 +21,10 @@ $ds-teaser-list-vertical-media-icon-size: 20px;
|
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
.ds-teaser-list-vertical__content a {
|
|
25
|
+
@include ds-teaser-focus(-2px);
|
|
26
|
+
}
|
|
27
|
+
|
|
23
28
|
.ds-teaser-list-vertical__link {
|
|
24
29
|
position: relative;
|
|
25
30
|
padding: ds-spacing($ds-s-100, rem);
|
|
@@ -101,10 +106,27 @@ $ds-teaser-list-vertical-media-icon-size: 20px;
|
|
|
101
106
|
margin: 0;
|
|
102
107
|
}
|
|
103
108
|
|
|
109
|
+
.ds-teaser-list-vertical__media-item-vignette {
|
|
110
|
+
display: block;
|
|
111
|
+
@include ds-typography($ds-typography-detailarticle-label);
|
|
112
|
+
color: $ds-theme-color;
|
|
113
|
+
margin-bottom: ds-spacing($ds-s-025);
|
|
114
|
+
}
|
|
115
|
+
|
|
104
116
|
.ds-teaser-list-vertical__media-item-title {
|
|
105
117
|
@include ds-typography($ds-typography-expressive-heading01bold);
|
|
106
118
|
color: $ds-color-text-primary;
|
|
107
119
|
word-break: break-word;
|
|
120
|
+
|
|
121
|
+
.ds-teaser-list-vertical__media-item-highlight {
|
|
122
|
+
color: $ds-theme-color;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&.ds-teaser-list-vertical__media-item--italic {
|
|
127
|
+
.ds-teaser-list-vertical__media-item-title {
|
|
128
|
+
@include ds-typography($ds-typography-expressive-heading01italicregular);
|
|
129
|
+
}
|
|
108
130
|
}
|
|
109
131
|
|
|
110
132
|
.ds-teaser-list-vertical__media-item-notes {
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
-
@use "../../assets/teaser/teaser.scss"
|
|
2
|
+
@use "../../assets/teaser/teaser.scss" as *;
|
|
3
3
|
|
|
4
4
|
.ds-teaser.ds-teaser--longlife {
|
|
5
5
|
position: relative;
|
|
6
6
|
|
|
7
|
+
&:focus-visible {
|
|
8
|
+
outline: none;
|
|
9
|
+
|
|
10
|
+
.ds-teaser__content {
|
|
11
|
+
@include ds-focus($offset: -8px, $includeSelector: false, $color: $ds-color-static-white);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
7
15
|
.ds-teaser-image {
|
|
8
16
|
position: relative;
|
|
9
17
|
width: 100%;
|
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
overflow: hidden;
|
|
7
7
|
border-bottom: 4px solid $ds-color-static-ad-yellow;
|
|
8
8
|
|
|
9
|
+
&:focus-visible {
|
|
10
|
+
outline: none;
|
|
11
|
+
|
|
12
|
+
.ds-teaser__content {
|
|
13
|
+
@include ds-teaser-focus(-8px, false);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
9
17
|
.ds-teaser__media {
|
|
10
18
|
margin-bottom: ds-spacing($ds-s-teaser-vertical-medium);
|
|
11
19
|
}
|
|
@@ -14,14 +14,24 @@
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
@mixin
|
|
18
|
-
|
|
17
|
+
@mixin _ds-focus($offset, $width, $color) {
|
|
18
|
+
outline: $width solid $color;
|
|
19
|
+
@if $offset {
|
|
20
|
+
outline-offset: $offset;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@mixin ds-focus(
|
|
25
|
+
$offset: false,
|
|
26
|
+
$includeSelector: true,
|
|
27
|
+
$width: ds-metrics-border-width(x2),
|
|
28
|
+
$color: $ds-color-border-focus-02
|
|
29
|
+
) {
|
|
30
|
+
@if not $includeSelector {
|
|
31
|
+
@include _ds-focus($offset, $width, $color);
|
|
32
|
+
} @else {
|
|
19
33
|
&:focus-visible {
|
|
20
|
-
|
|
21
|
-
outline-offset: $offset;
|
|
34
|
+
@include _ds-focus($offset, $width, $color);
|
|
22
35
|
}
|
|
23
|
-
} @else {
|
|
24
|
-
outline: ds-metrics-border-width(x2) solid $ds-color-border-focus-02;
|
|
25
|
-
outline-offset: $offset;
|
|
26
36
|
}
|
|
27
37
|
}
|
package/package.json
CHANGED