@bonniernews/dn-design-system-web 8.1.0 → 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 CHANGED
@@ -3,6 +3,15 @@
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
+
6
15
  ## 8.1.0 (2023-11-13)
7
16
 
8
17
 
@@ -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
 
@@ -64,7 +64,7 @@
64
64
  justify-content: space-between;
65
65
  flex: 1;
66
66
 
67
- @include ds-teaser-focus(-2px);
67
+ @include ds-focus(-2px);
68
68
 
69
69
  @include ds-link($ds-link-list);
70
70
 
@@ -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";
@@ -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);
@@ -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
  }
@@ -1,6 +1,6 @@
1
1
  @use "../../foundations/helpers/forward.helpers.scss" as *;
2
2
 
3
- @use "../../assets/teaser/teaser.scss";
3
+ @use "../../assets/teaser/teaser.scss" as *;
4
4
  @use "../../components/teaser-image/teaser-image.scss";
5
5
 
6
6
  .ds-teaser.ds-teaser-swipe-card {
@@ -14,14 +14,24 @@
14
14
  }
15
15
  }
16
16
 
17
- @mixin ds-teaser-focus($offset: 2px, $includeSelector: true) {
18
- @if $includeSelector {
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
- outline: ds-metrics-border-width(x2) solid $ds-color-border-focus-02;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "8.1.0",
3
+ "version": "8.1.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",