@bonniernews/dn-design-system-web 6.0.8 → 7.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
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
+ ## 7.0.0 (2023-10-11)
7
+
8
+
9
+ ### ⚠ BREAKING CHANGES
10
+
11
+ * **web:** Fonts now depend on css variables, if you do not load the base file it's required to load the file cssVariables.scss. This file replaces colors.scss and shadows.scss.
12
+
13
+ ### Code Refactoring
14
+
15
+ * **web:** use css var for font family ([#1056](https://github.com/BonnierNews/dn-design-system/issues/1056)) ([665989b](https://github.com/BonnierNews/dn-design-system/commit/665989b0b51c4ab73e1806e86ae72b21df27ee71))
16
+
17
+
18
+
6
19
  ## 6.0.8 (2023-10-10)
7
20
 
8
21
  **Note:** Version bump only for package @bonniernews/dn-design-system-web
@@ -82,7 +82,7 @@
82
82
  background-color: $ds-color-static-ad-yellow;
83
83
  display: flex;
84
84
  height: ds-px-to-rem(40px);
85
- @include ds-font-sans();
85
+ font-family: $ds-font--sans;
86
86
  font-size: ds-px-to-rem(16px);
87
87
  line-height: ds-px-to-rem(12px);
88
88
 
@@ -1,5 +1,4 @@
1
- @use "./colors.scss";
2
- @use "./shadows.scss";
1
+ @use "./cssVariables.scss";
3
2
  @use "./a11y/a11y.scss";
4
3
 
5
4
  html {
@@ -0,0 +1,3 @@
1
+ @use "./colors.scss";
2
+ @use "./fontFamily.scss";
3
+ @use "./shadows.scss";
@@ -0,0 +1,10 @@
1
+ :root {
2
+ --ds-font--sans: DNSans, Helvetica, Arial, sans-serif;
3
+ --ds-font--serif: DNSerif, Times, "Times New Roman", serif;
4
+ --ds-font--arial: Arial, Helvetica, sans-serif;
5
+
6
+ @supports (font-variation-settings: normal) {
7
+ --ds-font--sans: DNSansVF, Helvetica, Arial, sans-serif;
8
+ --ds-font--serif: DNSerifVF, Times, "Times New Roman", serif;
9
+ }
10
+ }
@@ -0,0 +1,3 @@
1
+ $ds-font--sans: var(--ds-font--sans);
2
+ $ds-font--serif: var(--ds-font--serif);
3
+ $ds-font--arial: var(--ds-font--arial);
@@ -1,4 +1,5 @@
1
1
  @forward "colors.scss";
2
+ @forward "fontFamily.scss";
2
3
  @forward "hover.scss";
3
4
  @forward "links.scss";
4
5
  @forward "loading.scss";
@@ -8,35 +8,10 @@
8
8
  @use "../variables/typographyTokensScreenSmall.scss" as *;
9
9
  @use "../variables/typographyTokensScreenLarge.scss" as *;
10
10
  @use "../variables/typographyTokensScreenExtraLarge.scss" as *;
11
+ @use "fontFamily.scss" as *;
11
12
  @forward "../variables/typographyTokensList.scss";
12
13
  @forward "../variables/decorations.scss";
13
14
 
14
- $ds-font--arial: Arial, Helvetica, sans-serif;
15
-
16
- @mixin ds-font-sans() {
17
- & {
18
- font-family: DNSans, Helvetica, Arial, sans-serif;
19
- }
20
-
21
- @supports (font-variation-settings: normal) {
22
- & {
23
- font-family: DNSansVF, Helvetica, Arial, sans-serif;
24
- }
25
- }
26
- }
27
-
28
- @mixin ds-font-serif() {
29
- & {
30
- font-family: DNSerif, Times, "Times New Roman", serif;
31
- }
32
-
33
- @supports (font-variation-settings: normal) {
34
- & {
35
- font-family: DNSerifVF, Times, "Times New Roman", serif;
36
- }
37
- }
38
- }
39
-
40
15
  $dsTypographyKeys: (
41
16
  fontFamily: "font-family",
42
17
  fontSize: "font-size",
@@ -143,9 +118,9 @@ $dsSerifWeights: (
143
118
 
144
119
  @if $key == "fontFamily" {
145
120
  @if $fontFamilyType == "serif" {
146
- @include ds-font-serif();
121
+ font-family: $ds-font--serif;
147
122
  } @else if $fontFamilyType == "sans" {
148
- @include ds-font-sans();
123
+ font-family: $ds-font--sans;
149
124
  }
150
125
  } @else if $key == "fontWeight" {
151
126
  $value: string.to-lower-case($value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "6.0.8",
3
+ "version": "7.0.0",
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",