@bonniernews/dn-design-system-web 0.1.0-alpha.49 → 0.1.0-alpha.53
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 +44 -0
- package/components/badge/README.md +1 -1
- package/components/button/README.md +1 -1
- package/components/button/button.njk +3 -3
- package/components/button/button.scss +4 -4
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/checkbox.njk +2 -2
- package/components/checkbox/checkbox.scss +3 -0
- package/components/divider/README.md +1 -1
- package/components/icon-button/README.md +1 -1
- package/components/icon-button/icon-button.njk +3 -3
- package/components/list-item/list-item.njk +10 -10
- package/components/list-item/list-item.scss +12 -12
- package/components/radio-button/README.md +1 -1
- package/components/radio-button/radio-button.njk +2 -2
- package/components/radio-button/radio-button.scss +3 -0
- package/components/switch/README.md +1 -1
- package/components/switch/switch.njk +2 -2
- package/components/switch/switch.scss +2 -2
- package/components/text-button/README.md +1 -1
- package/components/text-button/text-button.njk +3 -3
- package/components/text-input/README.md +1 -1
- package/foundations/typography/README.md +12 -26
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,50 @@
|
|
|
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
|
+
# [0.1.0-alpha.53](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@0.1.0-alpha.52...@bonniernews/dn-design-system-web@0.1.0-alpha.53) (2022-11-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **web:** mark attributes as safe ([#435](https://github.com/BonnierNews/dn-design-system/issues/435)) ([dd4338d](https://github.com/BonnierNews/dn-design-system/commit/dd4338dfb2daa3b717f1f598742b31555b1c895e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [0.1.0-alpha.52](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@0.1.0-alpha.51...@bonniernews/dn-design-system-web@0.1.0-alpha.52) (2022-11-17)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **web:** remove unnecessary disabled attributes from list item ([#430](https://github.com/BonnierNews/dn-design-system/issues/430)) ([90cc887](https://github.com/BonnierNews/dn-design-system/commit/90cc8875feb936a3a855e96a28ce9014a08a5f17))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# [0.1.0-alpha.51](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@0.1.0-alpha.50...@bonniernews/dn-design-system-web@0.1.0-alpha.51) (2022-11-17)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* **web:** update scss examples in readme ([#424](https://github.com/BonnierNews/dn-design-system/issues/424)) ([4c892d5](https://github.com/BonnierNews/dn-design-system/commit/4c892d5456a386262ec655abb16cdd8029dbc764))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
# 0.1.0-alpha.50 (2022-11-17)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Bug Fixes
|
|
43
|
+
|
|
44
|
+
* **web:** remove hover/active on disabled items ([#429](https://github.com/BonnierNews/dn-design-system/issues/429)) ([99703ce](https://github.com/BonnierNews/dn-design-system/commit/99703cecb536a0b6464051da6f2dafce733b26df))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
6
50
|
# [0.1.0-alpha.49](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@0.1.0-alpha.48...@bonniernews/dn-design-system-web@0.1.0-alpha.49) (2022-11-15)
|
|
7
51
|
|
|
8
52
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
{% set text = params.text %}
|
|
8
8
|
{% set attributes %}
|
|
9
9
|
{% for attribute, value in params.attributes %}
|
|
10
|
-
{{attribute}}={{value}}
|
|
10
|
+
{{attribute}}="{{value}}"
|
|
11
11
|
{% endfor %}
|
|
12
12
|
{% endset %}
|
|
13
13
|
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
{% set classes = componentClassName + " " + variant | join(" ") %}
|
|
46
46
|
|
|
47
47
|
{% if params.href %}
|
|
48
|
-
<a href="{{ params.href | default('#', true) }}" class="{{ classes }}" {{ attributes }}><div class="{{ componentClassName + '__inner'}}"><span>{{ text }}</span>{{- iconSvg | safe if iconSvg -}}</div></a>
|
|
48
|
+
<a href="{{ params.href | default('#', true) }}" class="{{ classes }}" {{- attributes | safe}}><div class="{{ componentClassName + '__inner'}}"><span>{{ text }}</span>{{- iconSvg | safe if iconSvg -}}</div></a>
|
|
49
49
|
{% else %}
|
|
50
|
-
<button type="{{ params.type | default('button') }}" class="{{ classes }}" {{ "disabled" if params.disabled }} {{ attributes }}><div class="{{ componentClassName + '__inner'}}"><span>{{ text }}</span>{{- iconSvg | safe if iconSvg -}}</div></button>
|
|
50
|
+
<button type="{{ params.type | default('button') }}" class="{{ classes }}" {{ "disabled" if params.disabled }} {{- attributes | safe}}><div class="{{ componentClassName + '__inner'}}"><span>{{ text }}</span>{{- iconSvg | safe if iconSvg -}}</div></button>
|
|
51
51
|
{% endif %}
|
|
52
52
|
{% endmacro %}
|
|
@@ -73,10 +73,10 @@ $ds-btn__icon-size: 24px;
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
&:hover .ds-btn__inner::before {
|
|
76
|
+
&:hover:not(:disabled) .ds-btn__inner::before {
|
|
77
77
|
background-color: var($ds-color-component-primary-overlay);
|
|
78
78
|
}
|
|
79
|
-
&:active .ds-btn__inner::before {
|
|
79
|
+
&:active:not(:disabled) .ds-btn__inner::before {
|
|
80
80
|
background-color: var($ds-color-component-primary-overlay-02);
|
|
81
81
|
}
|
|
82
82
|
&:disabled .ds-btn__inner {
|
|
@@ -199,10 +199,10 @@ $ds-btn__icon-size: 24px;
|
|
|
199
199
|
&:focus-visible .ds-btn__inner {
|
|
200
200
|
outline-color: var($ds-color-border-focus-02);
|
|
201
201
|
}
|
|
202
|
-
&:hover .ds-btn__inner::before {
|
|
202
|
+
&:hover:not(:disabled) .ds-btn__inner::before {
|
|
203
203
|
background-color: var($ds-color-component-secondary-overlay);
|
|
204
204
|
}
|
|
205
|
-
&:active .ds-btn__inner::before {
|
|
205
|
+
&:active:not(:disabled) .ds-btn__inner::before {
|
|
206
206
|
background-color: var($ds-color-component-secondary-overlay-02);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
@@ -38,5 +38,5 @@ These are copy paste friendly examples to quickliy get started using a component
|
|
|
38
38
|
|
|
39
39
|
### SCSS
|
|
40
40
|
```scss
|
|
41
|
-
@use "@bonniernews/dn-design-system-web/components/checkbox/checkbox
|
|
41
|
+
@use "@bonniernews/dn-design-system-web/components/checkbox/checkbox";
|
|
42
42
|
```
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
{% set name = params.name | default("ds-checkbox") %}
|
|
16
16
|
{% set attributes %}
|
|
17
17
|
{% for attribute, value in params.attributes %}
|
|
18
|
-
{{attribute}}={{value}}
|
|
18
|
+
{{attribute}}="{{value}}"
|
|
19
19
|
{% endfor %}
|
|
20
20
|
{% endset %}
|
|
21
21
|
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
{% set classes = componentClassName + " " + variant | join(" ") %}
|
|
39
39
|
|
|
40
40
|
<div class="{{ classes }}">
|
|
41
|
-
<input type="checkbox" id="{{ name }}" name="{{ name }}" {{- "checked" if params.checked }} {{ "disabled" if params.disabled }} {{-" required" if params.required }} {{- attributes }} />
|
|
41
|
+
<input type="checkbox" id="{{ name }}" name="{{ name }}" {{- "checked" if params.checked }} {{ "disabled" if params.disabled }} {{-" required" if params.required }} {{- attributes | safe }} />
|
|
42
42
|
{% if params.stripLabel %}
|
|
43
43
|
<div class="{{ componentClassName + '__inner'}}">
|
|
44
44
|
{{ CheckboxIcons(componentClassName) }}
|
|
@@ -38,5 +38,5 @@ These are copy paste friendly examples to quickliy get started using a component
|
|
|
38
38
|
|
|
39
39
|
### SCSS
|
|
40
40
|
```scss
|
|
41
|
-
@use "@bonniernews/dn-design-system-web/components/icon-button/icon-button
|
|
41
|
+
@use "@bonniernews/dn-design-system-web/components/icon-button/icon-button";
|
|
42
42
|
```
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
{% set variant = [] %}
|
|
8
8
|
{% set attributes %}
|
|
9
9
|
{% for attribute, value in params.attributes %}
|
|
10
|
-
{{attribute}}={{value}}
|
|
10
|
+
{{attribute}}="{{value}}"
|
|
11
11
|
{% endfor %}
|
|
12
12
|
{% endset %}
|
|
13
13
|
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
{% set classes = componentClassName + " " + variant | join(" ") %}
|
|
41
41
|
|
|
42
42
|
{% if params.href %}
|
|
43
|
-
<a href="{{ params.href | default('#', true) }}" class="{{ classes }}" {{ attributes }}>
|
|
43
|
+
<a href="{{ params.href | default('#', true) }}" class="{{ classes }}" {{- attributes | safe }}>
|
|
44
44
|
{{- visuallyHidden | safe if visuallyHidden -}}
|
|
45
45
|
<span class="{{ componentClassName + '__inner'}}">{{- iconSvg | safe if iconSvg -}}</span>
|
|
46
46
|
</a>
|
|
47
47
|
{% else %}
|
|
48
|
-
<button type="button" class="{{ classes }}" {{ "disabled" if params.disabled }} {{ attributes }}>
|
|
48
|
+
<button type="button" class="{{ classes }}" {{ "disabled" if params.disabled }} {{- attributes | safe }}>
|
|
49
49
|
{{- visuallyHidden | safe if visuallyHidden -}}
|
|
50
50
|
<span class="{{ componentClassName + '__inner'}}">{{- iconSvg | safe if iconSvg -}}</span>
|
|
51
51
|
</button>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
{% endif %}
|
|
29
29
|
</div>
|
|
30
30
|
{% endcall %}
|
|
31
|
-
</
|
|
31
|
+
</li>
|
|
32
32
|
{% endmacro %}
|
|
33
33
|
|
|
34
34
|
{# Internal helper macro - not intended for use outside of this file #}
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
{% set variant = [] %}
|
|
38
38
|
{% set attributes %}
|
|
39
39
|
{% for attribute, value in params.attributes %}
|
|
40
|
-
{{attribute}}={{value}}
|
|
40
|
+
{{attribute}}="{{value}}"
|
|
41
41
|
{% endfor %}
|
|
42
42
|
{% endset %}
|
|
43
43
|
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
{% endif %}
|
|
71
71
|
|
|
72
72
|
{% if params.listItemType == "standard" or not params.listItemType %}
|
|
73
|
-
{% set element = "link" if params.href else "button" %}
|
|
73
|
+
{% set element = "link" if params.href and not params.disabled else "button" %}
|
|
74
74
|
{% set variant = (variant.push(classNamePrefix + "standard"), variant) %}
|
|
75
75
|
{% else %}
|
|
76
76
|
{% set element = params.listItemType %}
|
|
@@ -80,15 +80,15 @@
|
|
|
80
80
|
{% set classes = componentClassName + " " + variant | join(" ") %}
|
|
81
81
|
|
|
82
82
|
{% if element == 'link' %}
|
|
83
|
-
<a class="{{ classes }}" {{
|
|
83
|
+
<a class="{{ classes }}" {{- attributes | safe }} href="#">
|
|
84
84
|
{{ caller() if caller }}
|
|
85
85
|
</a>
|
|
86
86
|
{% elif element == 'button' %}
|
|
87
|
-
<button class="{{ classes }}" {{ "disabled" if params.disabled }} {{ attributes }}>
|
|
87
|
+
<button class="{{ classes }}" {{ "disabled" if params.disabled }} {{- attributes | safe }}>
|
|
88
88
|
{{ caller() if caller }}
|
|
89
89
|
</button>
|
|
90
90
|
{% elif element == 'checkbox' %}
|
|
91
|
-
<div class="{{ classes }}" {{
|
|
91
|
+
<div class="{{ classes }}" {{- attributes | safe }}>
|
|
92
92
|
<label class="{{ componentClassName + '__wrapping-label'}}" for="{{ params.name }}"></label>
|
|
93
93
|
{% set iconLeftSvg %}
|
|
94
94
|
{{ Checkbox({
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
{{ caller() if caller }}
|
|
104
104
|
</div>
|
|
105
105
|
{% elif element == 'radio' %}
|
|
106
|
-
<div class="{{ classes }}" {{
|
|
106
|
+
<div class="{{ classes }}" {{- attributes | safe }}>
|
|
107
107
|
<label class="{{ componentClassName + '__wrapping-label'}}" for="{{ params.id }}"></label>
|
|
108
108
|
{% set iconLeftSvg %}
|
|
109
109
|
{{ RadioButton({
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
{{ caller() if caller }}
|
|
119
119
|
</div>
|
|
120
120
|
{% elif element == 'switch' %}
|
|
121
|
-
<div class="{{ classes }}" {{
|
|
121
|
+
<div class="{{ classes }}" {{- attributes | safe }}>
|
|
122
122
|
<label class="{{ componentClassName + '__wrapping-label'}}" for="{{ params.name }}"></label>
|
|
123
123
|
{% set iconRightSvg %}
|
|
124
124
|
{{ Switch({
|
|
@@ -138,14 +138,14 @@
|
|
|
138
138
|
{{ Icon({ icon: "expand_less" }) }}
|
|
139
139
|
{{ Icon({ icon: "expand_more" }) }}
|
|
140
140
|
{% endset %}
|
|
141
|
-
<button class="{{ classes }}" {{ "disabled" if params.disabled }} {{ attributes }}>
|
|
141
|
+
<button class="{{ classes }}" {{ "disabled" if params.disabled }} {{- attributes | safe }}>
|
|
142
142
|
{{ caller() if caller }}
|
|
143
143
|
</button>
|
|
144
144
|
<div class="{{ componentClassName + '__accordion-inner'}}">
|
|
145
145
|
{{ params.accordionContent | safe }}
|
|
146
146
|
</div>
|
|
147
147
|
{% else %}
|
|
148
|
-
<div class="{{ classes }}" {{
|
|
148
|
+
<div class="{{ classes }}" {{- attributes | safe }}>
|
|
149
149
|
{{ caller() if caller }}
|
|
150
150
|
</div>
|
|
151
151
|
{% endif %}
|
|
@@ -110,10 +110,10 @@ $ds-list-item__icon-size: 24px;
|
|
|
110
110
|
margin-left: ds-spacing-component(x4);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
&:hover .ds-list-item__inner::before {
|
|
113
|
+
&:hover:not(.ds-list-item--disabled) .ds-list-item__inner::before {
|
|
114
114
|
background-color: var($ds-color-component-primary-overlay);
|
|
115
115
|
}
|
|
116
|
-
&:active .ds-list-item__inner::before {
|
|
116
|
+
&:active:not(.ds-list-item--disabled) .ds-list-item__inner::before {
|
|
117
117
|
background-color: var($ds-color-component-primary-overlay-02);
|
|
118
118
|
}
|
|
119
119
|
&:focus-visible {
|
|
@@ -123,16 +123,6 @@ $ds-list-item__icon-size: 24px;
|
|
|
123
123
|
outline-offset: 2px;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
&:disabled {
|
|
127
|
-
cursor: not-allowed;
|
|
128
|
-
.ds-list-item__inner {
|
|
129
|
-
outline: none;
|
|
130
|
-
color: var($ds-color-icon-disabled);
|
|
131
|
-
&::before {
|
|
132
|
-
background-color: transparent;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
126
|
|
|
137
127
|
@at-root a#{&} {
|
|
138
128
|
box-sizing: border-box;
|
|
@@ -201,6 +191,16 @@ $ds-list-item__icon-size: 24px;
|
|
|
201
191
|
.ds-list-item__icon-right {
|
|
202
192
|
color: var($ds-color-icon-disabled);
|
|
203
193
|
}
|
|
194
|
+
|
|
195
|
+
.ds-list-item__wrapping-label::after {
|
|
196
|
+
cursor: not-allowed;
|
|
197
|
+
}
|
|
198
|
+
.ds-list-item__inner {
|
|
199
|
+
color: var($ds-color-icon-disabled);
|
|
200
|
+
&::before {
|
|
201
|
+
background-color: unset;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
.ds-list-item--accordion .ds-checkbox__accordion,
|
|
@@ -41,5 +41,5 @@ These are copy paste friendly examples to quickliy get started using a component
|
|
|
41
41
|
|
|
42
42
|
### SCSS
|
|
43
43
|
```scss
|
|
44
|
-
@use "@bonniernews/dn-design-system-web/components/radio-button/radio-button
|
|
44
|
+
@use "@bonniernews/dn-design-system-web/components/radio-button/radio-button";
|
|
45
45
|
```
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
{% set id = params.id | default("ds-radio-btn-id") %}
|
|
17
17
|
{% set attributes %}
|
|
18
18
|
{% for attribute, value in params.attributes %}
|
|
19
|
-
{{attribute}}={{value}}
|
|
19
|
+
{{attribute}}="{{value}}"
|
|
20
20
|
{% endfor %}
|
|
21
21
|
{% endset %}
|
|
22
22
|
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
{% set classes = componentClassName + " " + variant | join(" ") %}
|
|
40
40
|
|
|
41
41
|
<div class="{{ classes }}">
|
|
42
|
-
<input type="radio" id="{{ id }}" name="{{ name }}" {{- "checked" if params.checked }} {{ "disabled" if params.disabled }} {{-" required" if params.required }} {{- attributes }} value="{{ params.value }}" />
|
|
42
|
+
<input type="radio" id="{{ id }}" name="{{ name }}" {{- "checked" if params.checked }} {{ "disabled" if params.disabled }} {{-" required" if params.required }} {{- attributes | safe }} value="{{ params.value }}" />
|
|
43
43
|
{% if params.stripLabel %}
|
|
44
44
|
<div class="{{ componentClassName + '__inner'}}">
|
|
45
45
|
{{ RadioButtonIcons(componentClassName) }}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
{% set name = params.name | default("ds-switch") %}
|
|
17
17
|
{% set attributes %}
|
|
18
18
|
{% for attribute, value in params.attributes %}
|
|
19
|
-
{{attribute}}={{value}}
|
|
19
|
+
{{attribute}}="{{value}}"
|
|
20
20
|
{% endfor %}
|
|
21
21
|
{% endset %}
|
|
22
22
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
{% set classes = componentClassName + " " + variant | join(" ") %}
|
|
36
36
|
|
|
37
37
|
<div class="{{ classes }}">
|
|
38
|
-
<input type="checkbox" id="{{ name }}" name="{{ name }}" {{- "checked" if params.checked }} {{ "disabled" if params.disabled }} {{- attributes }} />
|
|
38
|
+
<input type="checkbox" id="{{ name }}" name="{{ name }}" {{- "checked" if params.checked }} {{ "disabled" if params.disabled }} {{- attributes | safe }} />
|
|
39
39
|
{% if params.stripLabel %}
|
|
40
40
|
<div class="{{ componentClassName + '__inner'}}">
|
|
41
41
|
{{ SwitchInner(params, componentClassName) }}
|
|
@@ -110,12 +110,12 @@ $ds-switch__container-width: 44px;
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
&:hover {
|
|
113
|
-
.ds-switch__box::before {
|
|
113
|
+
input:not(:disabled) + .ds-switch__box::before {
|
|
114
114
|
background-color: var($ds-color-component-primary-overlay);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
&:active {
|
|
118
|
-
.ds-switch__box::before {
|
|
118
|
+
input:not(:disabled) + .ds-switch__box::before {
|
|
119
119
|
background-color: var($ds-color-component-primary-overlay-02);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
@@ -40,5 +40,5 @@ These are copy paste friendly examples to quickliy get started using a component
|
|
|
40
40
|
|
|
41
41
|
### SCSS
|
|
42
42
|
```scss
|
|
43
|
-
@use "@bonniernews/dn-design-system-web/components/text-button/text-button
|
|
43
|
+
@use "@bonniernews/dn-design-system-web/components/text-button/text-button";
|
|
44
44
|
```
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
{% set text = params.text %}
|
|
8
8
|
{% set attributes %}
|
|
9
9
|
{% for attribute, value in params.attributes %}
|
|
10
|
-
{{attribute}}={{value}}
|
|
10
|
+
{{attribute}}="{{value}}"
|
|
11
11
|
{% endfor %}
|
|
12
12
|
{% endset %}
|
|
13
13
|
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
{% set classes = componentClassName + " " + variant | join(" ") %}
|
|
40
40
|
|
|
41
41
|
{% if params.href %}
|
|
42
|
-
<a href="{{ params.href | default('#', true) }}" class="{{ classes }}" {{ attributes }}><div class="{{ componentClassName + '__inner'}}"><span class="ds-text-btn__text">{{ text }}</span>{{- iconSvg | safe if iconSvg -}}</div></a>
|
|
42
|
+
<a href="{{ params.href | default('#', true) }}" class="{{ classes }}" {{- attributes | safe }}><div class="{{ componentClassName + '__inner'}}"><span class="ds-text-btn__text">{{ text }}</span>{{- iconSvg | safe if iconSvg -}}</div></a>
|
|
43
43
|
{% else %}
|
|
44
|
-
<button type="{{ params.type | default('button') }}" class="{{ classes }}" {{ "disabled" if params.disabled }} {{ attributes }}><div class="{{ componentClassName + '__inner'}}"><span class="ds-text-btn__text">{{ text }}</span>{{- iconSvg | safe if iconSvg -}}</div></button>
|
|
44
|
+
<button type="{{ params.type | default('button') }}" class="{{ classes }}" {{ "disabled" if params.disabled }} {{- attributes | safe }}><div class="{{ componentClassName + '__inner'}}"><span class="ds-text-btn__text">{{ text }}</span>{{- iconSvg | safe if iconSvg -}}</div></button>
|
|
45
45
|
{% endif %}
|
|
46
46
|
{% endmacro %}
|
|
@@ -45,7 +45,7 @@ These are copy paste friendly examples to quickliy get started using a component
|
|
|
45
45
|
### Scss
|
|
46
46
|
|
|
47
47
|
```scss
|
|
48
|
-
@use "@bonniernews/dn-design-system-web/components/text-input/text-input
|
|
48
|
+
@use "@bonniernews/dn-design-system-web/components/text-input/text-input";
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
### Javascript
|
|
@@ -4,35 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
# Typography
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
|parameter | type | required | options | default | description |
|
|
8
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
9
|
+
|token | Sass variable | yes | | | Ex. $ds-typography-functional-body01regular, all typography variables starts with prefix $ds-typography- |
|
|
10
|
+
|forcePx | bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/** or use typography token name directly: */
|
|
14
|
-
@include ds-typography(functional-body01regular);
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
To force 'px' (instead of rem) as unit for font-size, letter-spacing and line-height use the forcePx parameter:
|
|
18
|
-
```css
|
|
19
|
-
@include ds-typography($ds-typography-functional-body01regular, true);
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Or included as *text component*:
|
|
12
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
23
13
|
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
### SCSS
|
|
15
|
+
```scss
|
|
16
|
+
@use "@bonniernews/dn-design-system-web/foundations/helpers/typography" as *;
|
|
26
17
|
|
|
27
|
-
|
|
28
|
-
text: text,
|
|
29
|
-
textColor: textColor,
|
|
30
|
-
textComponent: textComponent
|
|
31
|
-
})}}
|
|
18
|
+
@include ds-typography($ds-typography-functional-body01regular);
|
|
32
19
|
```
|
|
33
20
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<span class="ds-t-body01regular">Body 01 Regular</span>
|
|
21
|
+
With forcePX parameter:
|
|
22
|
+
```scss
|
|
23
|
+
@include ds-typography($ds-typography-functional-body01regular, true);
|
|
38
24
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonniernews/dn-design-system-web",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.53",
|
|
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",
|