@bonniernews/dn-design-system-web 7.0.1 → 7.2.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/components/disclaimer/disclaimer.scss +3 -3
- package/components/teaser-split/teaser-split.scss +10 -10
- package/foundations/cssVariables.scss +1 -0
- package/foundations/helpers/README-spacing.md +21 -73
- package/foundations/helpers/spacing-deprecated.scss +77 -0
- package/foundations/helpers/spacing.scss +41 -57
- package/foundations/helpers/typography.scss +59 -33
- package/foundations/spacing.scss +24 -0
- package/foundations/variables/spacingBase.scss +14 -0
- package/foundations/variables/spacingBaseList.scss +12 -0
- package/foundations/variables/spacingDetail.scss +15 -0
- package/foundations/variables/spacingDetailList.scss +13 -0
- package/foundations/variables/spacingDetailScreenLarge.scss +15 -0
- package/package.json +1 -1
- package/tokens/spacing-base-list.json +14 -0
- package/tokens/spacing-detail-list.json +15 -0
- /package/foundations/variables/{spacingComponent.scss → deprecated/spacingComponent.scss} +0 -0
- /package/foundations/variables/{spacingComponentList.scss → deprecated/spacingComponentList.scss} +0 -0
- /package/foundations/variables/{spacingLayout.scss → deprecated/spacingLayout.scss} +0 -0
- /package/foundations/variables/{spacingLayoutLargeScreen.scss → deprecated/spacingLayoutLargeScreen.scss} +0 -0
- /package/foundations/variables/{spacingLayoutList.scss → deprecated/spacingLayoutList.scss} +0 -0
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
|
+
## 7.2.0 (2023-10-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **web:** limit scaling for large fonts ([#1063](https://github.com/BonnierNews/dn-design-system/issues/1063)) ([213a9b9](https://github.com/BonnierNews/dn-design-system/commit/213a9b93fcb46ea459519f83a1a2af28fe665045))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## 7.1.0 (2023-10-20)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **web:** refactored spacing ([#1062](https://github.com/BonnierNews/dn-design-system/issues/1062)) ([6d76bc0](https://github.com/BonnierNews/dn-design-system/commit/6d76bc07dfb193333ebf841962e9a42560e77a74))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## 7.0.1 (2023-10-20)
|
|
7
25
|
|
|
8
26
|
|
|
@@ -5,18 +5,18 @@ $ds-disclaimer__icon-size: 20px;
|
|
|
5
5
|
$ds-btn-outlined__border-width: ds-metrics-border-width(x1);
|
|
6
6
|
|
|
7
7
|
.ds-disclaimer {
|
|
8
|
-
|
|
8
|
+
padding-bottom: ds-spacing($ds-s-gap-vertical-static-medium);
|
|
9
9
|
box-sizing: border-box;
|
|
10
10
|
|
|
11
11
|
.ds-disclaimer__body-html,
|
|
12
12
|
.ds-disclaimer__icon-wrapper {
|
|
13
13
|
background-color: $ds-color-surface-raised;
|
|
14
|
-
padding: ds-spacing
|
|
14
|
+
padding: ds-spacing($ds-s-075 $ds-s-100);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.ds-disclaimer__icon-wrapper {
|
|
18
18
|
// instead of margin to keep background color
|
|
19
|
-
padding-right: ds-spacing
|
|
19
|
+
padding-right: ds-spacing($ds-s-050);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.ds-disclaimer__body-html {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
@use "../../assets/teaser/teaser.scss" as *;
|
|
3
3
|
|
|
4
4
|
.ds-split-container {
|
|
5
|
-
|
|
6
|
-
$ds-
|
|
5
|
+
padding: ds-spacing(
|
|
6
|
+
$ds-s-teaser-vertical-small $ds-s-teaser-horizontal
|
|
7
7
|
$ds-sl-teaser-vertical-medium
|
|
8
8
|
);
|
|
9
9
|
display: flex;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
right: 0;
|
|
22
22
|
top: 0;
|
|
23
23
|
position: absolute;
|
|
24
|
-
|
|
24
|
+
margin: ds-spacing(0 $ds-s-teaser-horizontal);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
display: block;
|
|
31
31
|
position: relative;
|
|
32
32
|
flex: 1;
|
|
33
|
-
margin-right: ds-spacing
|
|
33
|
+
margin-right: ds-spacing($ds-s-100);
|
|
34
34
|
&:last-child {
|
|
35
35
|
margin-right: 0;
|
|
36
36
|
}
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
@include ds-teaser-focus(4px);
|
|
39
39
|
|
|
40
40
|
@include ds-mq-largest-breakpoint(mobile) {
|
|
41
|
-
width: calc(50% - ds-spacing
|
|
41
|
+
width: calc(50% - ds-spacing($ds-s-100) / 2);
|
|
42
42
|
flex: auto;
|
|
43
43
|
// if a teaser is both third and last child it has the row by itself and should be full width
|
|
44
44
|
&:nth-child(3):last-child {
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
&:nth-child(4)::before {
|
|
54
54
|
display: block;
|
|
55
55
|
content: "";
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
margin-top: ds-spacing($ds-s-teaser-vertical-medium);
|
|
57
|
+
padding-top: ds-spacing($ds-s-teaser-vertical-small);
|
|
58
58
|
border-top: ds-metrics-border-width(x1) solid $ds-color-border-primary;
|
|
59
59
|
|
|
60
60
|
@include ds-mq-smallest-breakpoint(tablet) {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
&:nth-child(3):not(:last-child)::before {
|
|
68
|
-
margin-right: ds-spacing
|
|
68
|
+
margin-right: ds-spacing($ds-s-100, "px", true);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
.ds-teaser__title {
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
|
|
75
75
|
.ds-teaser__media {
|
|
76
76
|
@include ds-mq-largest-breakpoint(mobile) {
|
|
77
|
-
margin-bottom: ds-spacing
|
|
77
|
+
margin-bottom: ds-spacing($ds-s-050);
|
|
78
78
|
|
|
79
79
|
.ds-teaser-image__byline {
|
|
80
80
|
display: none;
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
@include ds-mq-smallest-breakpoint(tablet) {
|
|
85
|
-
margin-bottom: ds-spacing
|
|
85
|
+
margin-bottom: ds-spacing($ds-s-075);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
- GitHub: [BonnierNews/dn-design-system/../web/src/foundations/helpers/spacing.scss](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/foundations/helpers/spacing.scss)
|
|
2
|
-
- Storybook: [Spacing >
|
|
3
|
-
- Storybook: [Spacing >
|
|
2
|
+
- Storybook: [Spacing > Base](https://designsystem.dn.se/?path=/story/foundations-spacing--base)
|
|
3
|
+
- Storybook: [Spacing > Detail](https://designsystem.dn.se/?path=/story/foundations-spacing--detail)
|
|
4
4
|
|
|
5
5
|
----
|
|
6
6
|
|
|
@@ -9,102 +9,50 @@
|
|
|
9
9
|
## use sass variable
|
|
10
10
|
To avoid silent breaking changes use sass variable instead of raw token name.
|
|
11
11
|
|
|
12
|
-
Ex: `margin: ds-spacing
|
|
13
|
-
|
|
14
|
-
Ex: `@include ds-spacing-layout($ds-sl-page-horizontal auto, padding-top)`
|
|
12
|
+
Ex: `margin: ds-spacing($ds-s-050 0 $ds-s-page-horizontal)`
|
|
15
13
|
|
|
16
14
|
By using sass variables (instead of token name directly), if a spacing token used in scss is removed sass will not compile - which is a good thing!
|
|
17
15
|
|
|
18
16
|
By using sass variables for spacing tokens you will see which tokens are available through auto complete.
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
Variables with `$ds-sl-` prefix are available for `ds-spacing-layout()`
|
|
23
|
-
|
|
24
|
-
## ds-spacing-component | function
|
|
25
|
-
|
|
26
|
-
Use for space _inside_ a component (or atom).
|
|
27
|
-
|
|
28
|
-
Dynamic spacings are static and are _not_ wrapped in any media query, the function only return values.
|
|
18
|
+
## ds-spacing | function
|
|
29
19
|
|
|
30
20
|
### Parameters
|
|
31
21
|
|
|
32
22
|
|parameter | type | required | options | default | description |
|
|
33
23
|
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
34
|
-
|units | String | yes | one or more spacing tokens or `auto` or `0`
|
|
35
|
-
|sizeUnit | String | no | px, rem
|
|
24
|
+
|units | String | yes | one or more spacing tokens or `auto` or `0` or numeric value `14`| | $ds-s-050 0 $ds-s-page-horizontal 14 |
|
|
25
|
+
|sizeUnit | String | no | px, rem | px | |
|
|
36
26
|
|negative | bool | no | true, false | false | Applies to all units except for `auto` and `0` |
|
|
37
27
|
|
|
38
28
|
```scss
|
|
39
29
|
@use "@bonniernews/dn-design-system-web/foundations/helpers/forward.helpers.scss" as *;
|
|
40
30
|
|
|
41
31
|
.test-1 {
|
|
42
|
-
margin: ds-spacing
|
|
32
|
+
margin: ds-spacing($ds-s-050 0 $ds-s-page-horizontal auto);
|
|
33
|
+
padding: ds-spacing($ds-s-125 14);
|
|
43
34
|
}
|
|
44
35
|
|
|
45
36
|
// Outputs:
|
|
46
|
-
4px 8px 0
|
|
47
|
-
|
|
48
|
-
.test-2 {
|
|
49
|
-
margin: ds-spacing-component($ds-sc-x1 $ds-sc-x2 0, px, true);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Outputs:
|
|
53
|
-
-4px -8px 0
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## ds-spacing-layout | mixin
|
|
57
|
-
|
|
58
|
-
Use for space _between_ components.
|
|
59
|
-
|
|
60
|
-
This mixin returns `property: value` wrapped in media query.
|
|
61
|
-
|
|
62
|
-
### Parameters
|
|
63
|
-
|
|
64
|
-
|parameter | type | required | options | default | description |
|
|
65
|
-
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
66
|
-
|units | String | yes | one or more spacing tokens or `auto` or `0` | | Ex. 0 page-horizontal |
|
|
67
|
-
|property | String | no | padding, margin | padding | Use padding for layout spacing to avoid collapsing margins|
|
|
68
|
-
|sizeUnit | String | no | px, rem, em | px | |
|
|
69
|
-
|negative | bool | no | true, false | false | Applies to all units except for `auto` and `0` |
|
|
70
|
-
|
|
71
|
-
```scss
|
|
72
|
-
@use "@bonniernews/dn-design-system-web/foundations/helpers/forward.helpers.scss" as *;
|
|
73
|
-
|
|
74
37
|
.test-1 {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
// Outputs:
|
|
79
|
-
@media (max-width: 1024px) {
|
|
80
|
-
.test-1 {
|
|
81
|
-
padding-top: 16px;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
@media (min-width: 1025px) {
|
|
85
|
-
.test-1 {
|
|
86
|
-
padding-top: 32px;
|
|
87
|
-
}
|
|
38
|
+
margin: 8px 0 var(--ds-spacing-px-page-horizontal) auto;
|
|
39
|
+
padding: 20px 14px;
|
|
88
40
|
}
|
|
89
41
|
|
|
90
42
|
.test-2 {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
margin,
|
|
94
|
-
px,
|
|
95
|
-
true
|
|
96
|
-
);
|
|
43
|
+
margin: ds-spacing($ds-s-050 0 $ds-s-page-horizontal auto, rem, true);
|
|
44
|
+
padding: ds-spacing($ds-s-125 14, rem);
|
|
97
45
|
}
|
|
98
46
|
|
|
99
47
|
// Outputs:
|
|
100
|
-
|
|
101
|
-
.
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
@media (min-width: 1025px) {
|
|
106
|
-
.test-2 {
|
|
107
|
-
margin: 0 -32px;
|
|
108
|
-
}
|
|
48
|
+
.test-2 {
|
|
49
|
+
margin: -0.5rem 0 var(--ds-spacing-negative-rem-page-horizontal) auto;
|
|
50
|
+
padding: 1.25rem 0.875rem;
|
|
109
51
|
}
|
|
110
52
|
```
|
|
53
|
+
|
|
54
|
+
## ⚠️ Deprecated functions and mixins
|
|
55
|
+
|
|
56
|
+
The function `ds-spacing-component()` is deprecated.
|
|
57
|
+
|
|
58
|
+
The mixin `@include ds-spacing-layout()` is deprecated.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
@use "sass:list";
|
|
2
|
+
@use "sass:math";
|
|
3
|
+
@use "sass:map";
|
|
4
|
+
@use "mediaQueries.scss" as *;
|
|
5
|
+
@use "../variables/deprecated/spacingComponent.scss" as *;
|
|
6
|
+
@use "../variables/deprecated/spacingLayout.scss" as *;
|
|
7
|
+
@use "../variables/deprecated/spacingLayoutLargeScreen.scss" as *;
|
|
8
|
+
@forward "../variables/deprecated/spacingComponentList.scss";
|
|
9
|
+
@forward "../variables/deprecated/spacingLayoutList.scss";
|
|
10
|
+
|
|
11
|
+
@function ds-spacing-component(
|
|
12
|
+
$units: null,
|
|
13
|
+
$sizeUnit: "px",
|
|
14
|
+
$negative: false
|
|
15
|
+
) {
|
|
16
|
+
@if $units {
|
|
17
|
+
@return _ds-get-spacings-deprecated($spacingComponent, $units, $sizeUnit, $negative);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@mixin ds-spacing-layout(
|
|
24
|
+
$units: null,
|
|
25
|
+
$property: padding,
|
|
26
|
+
$sizeUnit: "px",
|
|
27
|
+
$negative: false
|
|
28
|
+
) {
|
|
29
|
+
@if $units {
|
|
30
|
+
$values: _ds-get-spacings-deprecated($spacingLayout, $units, $sizeUnit, $negative);
|
|
31
|
+
@include ds-mq-largest-breakpoint(mobile) {
|
|
32
|
+
#{$property}: $values;
|
|
33
|
+
}
|
|
34
|
+
$valuesLargeScreen: _ds-get-spacings-deprecated(
|
|
35
|
+
$spacingLayoutLargeScreen,
|
|
36
|
+
$units,
|
|
37
|
+
$sizeUnit,
|
|
38
|
+
$negative
|
|
39
|
+
);
|
|
40
|
+
@include ds-mq-smallest-breakpoint(tablet) {
|
|
41
|
+
#{$property}: $valuesLargeScreen;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@function _ds-get-spacings-deprecated($map, $units, $sizeUnit: "px", $negative: false) {
|
|
47
|
+
$values: ();
|
|
48
|
+
|
|
49
|
+
@each $unit in $units {
|
|
50
|
+
$value: map.get($map, $unit);
|
|
51
|
+
@if ($unit == "auto") {
|
|
52
|
+
$value: auto;
|
|
53
|
+
} @else if ($unit == 0) {
|
|
54
|
+
$value: 0 * 1;
|
|
55
|
+
} @else if ($value and type-of($value) == "number") {
|
|
56
|
+
@if ($sizeUnit == "rem") {
|
|
57
|
+
$value: (math.div($value, 16)) * 1rem;
|
|
58
|
+
} @else if ($sizeUnit == "em") {
|
|
59
|
+
$value: (math.div($value, 16)) * 1em;
|
|
60
|
+
} @else {
|
|
61
|
+
$value: $value * 1px;
|
|
62
|
+
}
|
|
63
|
+
@if $negative {
|
|
64
|
+
$value: $value * -1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
@if (type-of($value) == "number" or $value == "auto") {
|
|
68
|
+
$values: list.append($values, $value);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@if length($values) == 1 {
|
|
73
|
+
@return list.nth($values, 1);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@return $values;
|
|
77
|
+
}
|
|
@@ -2,76 +2,60 @@
|
|
|
2
2
|
@use "sass:math";
|
|
3
3
|
@use "sass:map";
|
|
4
4
|
@use "mediaQueries.scss" as *;
|
|
5
|
-
@use "../variables/
|
|
6
|
-
@
|
|
7
|
-
@use "../variables/
|
|
8
|
-
@
|
|
9
|
-
@forward "../variables/
|
|
5
|
+
@use "../variables/spacingBase.scss" as *;
|
|
6
|
+
@forward "../variables/spacingBaseList.scss";
|
|
7
|
+
@use "../variables/spacingDetail.scss" as *;
|
|
8
|
+
@use "../variables/spacingDetailScreenLarge.scss" as *;
|
|
9
|
+
@forward "../variables/spacingDetailList.scss";
|
|
10
10
|
|
|
11
|
-
@
|
|
12
|
-
|
|
13
|
-
$sizeUnit: "px",
|
|
14
|
-
$negative: false
|
|
15
|
-
) {
|
|
16
|
-
@if $units {
|
|
17
|
-
@return _ds-get-spacings($spacingComponent, $units, $sizeUnit, $negative);
|
|
18
|
-
}
|
|
11
|
+
// @todo remove when possible
|
|
12
|
+
@forward "spacing-deprecated.scss";
|
|
19
13
|
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@mixin ds-spacing-layout(
|
|
14
|
+
@function ds-spacing(
|
|
24
15
|
$units: null,
|
|
25
|
-
$property: padding,
|
|
26
16
|
$sizeUnit: "px",
|
|
27
17
|
$negative: false
|
|
28
18
|
) {
|
|
29
19
|
@if $units {
|
|
30
|
-
$values:
|
|
31
|
-
@include ds-mq-largest-breakpoint(mobile) {
|
|
32
|
-
#{$property}: $values;
|
|
33
|
-
}
|
|
34
|
-
$valuesLargeScreen: _ds-get-spacings(
|
|
35
|
-
$spacingLayoutLargeScreen,
|
|
36
|
-
$units,
|
|
37
|
-
$sizeUnit,
|
|
38
|
-
$negative
|
|
39
|
-
);
|
|
40
|
-
@include ds-mq-smallest-breakpoint(tablet) {
|
|
41
|
-
#{$property}: $valuesLargeScreen;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
20
|
+
$values: ();
|
|
45
21
|
|
|
46
|
-
@
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
} @else if ($unit == 0) {
|
|
54
|
-
$value: 0 * 1;
|
|
55
|
-
} @else if ($value and type-of($value) == "number") {
|
|
56
|
-
@if ($sizeUnit == "rem") {
|
|
57
|
-
$value: (math.div($value, 16)) * 1rem;
|
|
58
|
-
} @else if ($sizeUnit == "em") {
|
|
59
|
-
$value: (math.div($value, 16)) * 1em;
|
|
22
|
+
@each $unit in $units {
|
|
23
|
+
@if map.has-key($spacingDetail, $unit) {
|
|
24
|
+
$value: var(--ds-spacing-#{$sizeUnit}-#{$unit});
|
|
25
|
+
@if ($negative) {
|
|
26
|
+
$value: calc(var(--ds-spacing-#{$sizeUnit}-#{$unit}) * -1);
|
|
27
|
+
}
|
|
28
|
+
$values: list.append($values, $value);
|
|
60
29
|
} @else {
|
|
61
|
-
$value: $
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
30
|
+
$value: $unit;
|
|
31
|
+
@if map.has-key($spacingBase, $unit) {
|
|
32
|
+
$value: map.get($spacingBase, $unit);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@if ($value == 0) {
|
|
36
|
+
$value: 0 * 1;
|
|
37
|
+
} @else if ($value and type-of($value) == "number") {
|
|
38
|
+
@if ($sizeUnit == "rem") {
|
|
39
|
+
$value: (math.div($value, 16)) * 1rem;
|
|
40
|
+
} @else {
|
|
41
|
+
$value: $value * 1px;
|
|
42
|
+
}
|
|
43
|
+
@if $negative {
|
|
44
|
+
$value: $value * -1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
@if (type-of($value) == "number" or $value == "auto") {
|
|
48
|
+
$values: list.append($values, $value);
|
|
49
|
+
}
|
|
65
50
|
}
|
|
66
51
|
}
|
|
67
|
-
|
|
68
|
-
|
|
52
|
+
|
|
53
|
+
@if length($values) == 1 {
|
|
54
|
+
@return list.nth($values, 1);
|
|
69
55
|
}
|
|
70
|
-
}
|
|
71
56
|
|
|
72
|
-
|
|
73
|
-
@return list.nth($values, 1);
|
|
57
|
+
@return $values;
|
|
74
58
|
}
|
|
75
59
|
|
|
76
|
-
@return
|
|
60
|
+
@return null;
|
|
77
61
|
}
|
|
@@ -70,7 +70,8 @@ $dsSerifWeights: (
|
|
|
70
70
|
@include _ds-typography-get-property(
|
|
71
71
|
$tmpMapScreenLarge,
|
|
72
72
|
$key,
|
|
73
|
-
$forcePx
|
|
73
|
+
$forcePx,
|
|
74
|
+
"large"
|
|
74
75
|
);
|
|
75
76
|
}
|
|
76
77
|
}
|
|
@@ -83,7 +84,8 @@ $dsSerifWeights: (
|
|
|
83
84
|
@include _ds-typography-get-property(
|
|
84
85
|
$tmpMapScreenExtraLarge,
|
|
85
86
|
$key,
|
|
86
|
-
$forcePx
|
|
87
|
+
$forcePx,
|
|
88
|
+
"extraLarge"
|
|
87
89
|
);
|
|
88
90
|
}
|
|
89
91
|
}
|
|
@@ -109,46 +111,70 @@ $dsSerifWeights: (
|
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
113
|
|
|
112
|
-
@mixin _ds-typography-get-property($map, $key, $forcePx) {
|
|
114
|
+
@mixin _ds-typography-get-property($map, $key, $forcePx, $screen: "small") {
|
|
113
115
|
$unit: "";
|
|
114
116
|
$value: map.get($map, $key);
|
|
115
117
|
$fontFamilyType: _ds-get-font-family-type($map);
|
|
116
118
|
$fontWeights: if($fontFamilyType == "serif", $dsSerifWeights, $dsSansWeights);
|
|
117
|
-
$canForcePx: list.index((fontSize, lineHeight, letterSpacing), $key);
|
|
118
119
|
|
|
119
|
-
@if $
|
|
120
|
-
@if $
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
$
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
@if $
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
120
|
+
@if $value != "" {
|
|
121
|
+
@if $key == "fontFamily" {
|
|
122
|
+
@if $fontFamilyType == "serif" {
|
|
123
|
+
font-family: $ds-font--serif;
|
|
124
|
+
} @else if $fontFamilyType == "sans" {
|
|
125
|
+
font-family: $ds-font--sans;
|
|
126
|
+
}
|
|
127
|
+
} @else if $key == "fontWeight" {
|
|
128
|
+
$value: string.to-lower-case($value);
|
|
129
|
+
@if map-has-key($fontWeights, $value) {
|
|
130
|
+
$value: map.get($fontWeights, $value);
|
|
131
|
+
}
|
|
132
|
+
font-weight: #{$value};
|
|
133
|
+
} @else if $key == "fontStyle" {
|
|
134
|
+
font-style: string.to-lower-case($value);
|
|
135
|
+
} @else if $key == "fontSize" {
|
|
136
|
+
@if $forcePx {
|
|
137
|
+
font-size: $value * 1px;
|
|
138
|
+
} @else {
|
|
139
|
+
font-size: ds-px-to-rem($value);
|
|
140
|
+
font-size: clamp($value * 1px, ds-px-to-rem($value), _ds-get-max-scaled-size($value, $screen));
|
|
141
|
+
}
|
|
142
|
+
font-variation-settings: "opsz" $value;
|
|
143
|
+
} @else if $key == "lineHeight" {
|
|
144
|
+
@if $forcePx {
|
|
145
|
+
line-height: $value * 1px;
|
|
146
|
+
} @else {
|
|
147
|
+
line-height: ds-px-to-rem($value);
|
|
148
|
+
line-height: clamp($value * 1px, ds-px-to-rem($value), _ds-get-max-scaled-size($value, $screen));
|
|
149
|
+
}
|
|
150
|
+
} @else if $key == "letterSpacing" {
|
|
151
|
+
@if $forcePx {
|
|
152
|
+
$value: $value * 1px;
|
|
153
|
+
} @else {
|
|
154
|
+
$value: ds-px-to-rem($value);
|
|
155
|
+
}
|
|
156
|
+
#{map.get($dsTypographyKeys, $key)}: $value;
|
|
157
|
+
} @else if index(map-keys($dsTypographyKeys), $key) {
|
|
158
|
+
#{map.get($dsTypographyKeys, $key)}: $value;
|
|
145
159
|
}
|
|
146
|
-
#{map.get($dsTypographyKeys, $key)}: $value;
|
|
147
|
-
} @else if index(map-keys($dsTypographyKeys), $key) and $value != "" {
|
|
148
|
-
#{map.get($dsTypographyKeys, $key)}: $value;
|
|
149
160
|
}
|
|
150
161
|
}
|
|
151
162
|
|
|
163
|
+
@function _ds-get-max-scaled-size($size, $screen: "small") {
|
|
164
|
+
$midPoint: 26;
|
|
165
|
+
$scalingFactor: 0.33;
|
|
166
|
+
@if ($screen == "large") {
|
|
167
|
+
$midPoint: 30;
|
|
168
|
+
$scalingFactor: 0.2;
|
|
169
|
+
} @else if ($screen == "extraLarge") {
|
|
170
|
+
$midPoint: 32;
|
|
171
|
+
$scalingFactor: 0.166;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
$calculatedScalingFactor: 2 - math.div(1, (1 + math.pow(math.$e, $scalingFactor * ($midPoint - $size))));
|
|
175
|
+
@return math.round($calculatedScalingFactor * $size * 1px);
|
|
176
|
+
}
|
|
177
|
+
|
|
152
178
|
@function _ds-get-font-family-type($map) {
|
|
153
179
|
$fontFamily: map.get($map, "fontFamily");
|
|
154
180
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:meta";
|
|
3
|
+
@use "./variables/spacingDetail";
|
|
4
|
+
@use "./variables/spacingDetailScreenLarge";
|
|
5
|
+
@use "./helpers/mediaQueries.scss" as *;
|
|
6
|
+
@use "./helpers/utilities.scss" as *;
|
|
7
|
+
|
|
8
|
+
:root {
|
|
9
|
+
@each $name, $map in meta.module-variables("spacingDetail") {
|
|
10
|
+
@each $key in map-keys($map) {
|
|
11
|
+
--ds-spacing-px-#{$key}: #{map.get($map, $key) * 1px};
|
|
12
|
+
--ds-spacing-rem-#{$key}: #{ds-px-to-rem(map.get($map, $key))};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@include ds-mq-smallest-breakpoint(tablet) {
|
|
17
|
+
@each $name, $map in meta.module-variables("spacingDetailScreenLarge") {
|
|
18
|
+
@each $key in map-keys($map) {
|
|
19
|
+
--ds-spacing-px-#{$key}: #{map.get($map, $key) * 1px};
|
|
20
|
+
--ds-spacing-rem-#{$key}: #{ds-px-to-rem(map.get($map, $key))};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
$spacingDetail: (
|
|
2
|
+
outer: 16,
|
|
3
|
+
outer-negative: -16,
|
|
4
|
+
page-horizontal: 16,
|
|
5
|
+
page-top-small: 16,
|
|
6
|
+
gap-vertical-static-medium: 16,
|
|
7
|
+
gap-vertical-medium: 16,
|
|
8
|
+
gap-vertical-static-large: 32,
|
|
9
|
+
gap-vertical-static-small: 8,
|
|
10
|
+
page-top-xsmall: 4,
|
|
11
|
+
teaser-vertical-small: 8,
|
|
12
|
+
teaser-horizontal: 16,
|
|
13
|
+
teaser-vertical-medium: 12,
|
|
14
|
+
direkt-header-bottom: 48
|
|
15
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
$ds-s-outer: outer;
|
|
2
|
+
$ds-s-outer-negative: outer-negative;
|
|
3
|
+
$ds-s-page-horizontal: page-horizontal;
|
|
4
|
+
$ds-s-page-top-small: page-top-small;
|
|
5
|
+
$ds-s-gap-vertical-static-medium: gap-vertical-static-medium;
|
|
6
|
+
$ds-s-gap-vertical-medium: gap-vertical-medium;
|
|
7
|
+
$ds-s-gap-vertical-static-large: gap-vertical-static-large;
|
|
8
|
+
$ds-s-gap-vertical-static-small: gap-vertical-static-small;
|
|
9
|
+
$ds-s-page-top-xsmall: page-top-xsmall;
|
|
10
|
+
$ds-s-teaser-vertical-small: teaser-vertical-small;
|
|
11
|
+
$ds-s-teaser-horizontal: teaser-horizontal;
|
|
12
|
+
$ds-s-teaser-vertical-medium: teaser-vertical-medium;
|
|
13
|
+
$ds-s-direkt-header-bottom: direkt-header-bottom;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
$spacingDetailScreenLarge: (
|
|
2
|
+
page-top-small: 32,
|
|
3
|
+
page-horizontal: 32,
|
|
4
|
+
gap-vertical-medium: 32,
|
|
5
|
+
teaser-vertical-small: 12,
|
|
6
|
+
teaser-horizontal: 16,
|
|
7
|
+
teaser-vertical-medium: 16,
|
|
8
|
+
direkt-header-bottom: 64,
|
|
9
|
+
outer: 16,
|
|
10
|
+
outer-negative: -16,
|
|
11
|
+
gap-vertical-static-medium: 16,
|
|
12
|
+
gap-vertical-static-large: 32,
|
|
13
|
+
gap-vertical-static-small: 8,
|
|
14
|
+
page-top-xsmall: 4
|
|
15
|
+
);
|
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"outer": "outer",
|
|
3
|
+
"outer-negative": "outer-negative",
|
|
4
|
+
"page-horizontal": "page-horizontal",
|
|
5
|
+
"page-top-small": "page-top-small",
|
|
6
|
+
"gap-vertical-static-medium": "gap-vertical-static-medium",
|
|
7
|
+
"gap-vertical-medium": "gap-vertical-medium",
|
|
8
|
+
"gap-vertical-static-large": "gap-vertical-static-large",
|
|
9
|
+
"gap-vertical-static-small": "gap-vertical-static-small",
|
|
10
|
+
"page-top-xsmall": "page-top-xsmall",
|
|
11
|
+
"teaser-vertical-small": "teaser-vertical-small",
|
|
12
|
+
"teaser-horizontal": "teaser-horizontal",
|
|
13
|
+
"teaser-vertical-medium": "teaser-vertical-medium",
|
|
14
|
+
"direkt-header-bottom": "direkt-header-bottom"
|
|
15
|
+
}
|
|
File without changes
|
/package/foundations/variables/{spacingComponentList.scss → deprecated/spacingComponentList.scss}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|