@bonniernews/dn-design-system-web 0.1.0-alpha.49 → 0.1.0-alpha.56

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,77 @@
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.56](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@0.1.0-alpha.55...@bonniernews/dn-design-system-web@0.1.0-alpha.56) (2022-11-21)
7
+
8
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
9
+
10
+
11
+
12
+
13
+
14
+ # [0.1.0-alpha.55](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@0.1.0-alpha.54...@bonniernews/dn-design-system-web@0.1.0-alpha.55) (2022-11-21)
15
+
16
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
17
+
18
+
19
+
20
+
21
+
22
+ # [0.1.0-alpha.54](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@0.1.0-alpha.53...@bonniernews/dn-design-system-web@0.1.0-alpha.54) (2022-11-21)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **web:** update readme ([#439](https://github.com/BonnierNews/dn-design-system/issues/439)) ([8f4ad72](https://github.com/BonnierNews/dn-design-system/commit/8f4ad720f0d7be0ac356440ff6bb1af1d558812f))
28
+
29
+
30
+
31
+
32
+
33
+ # [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)
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * **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))
39
+
40
+
41
+
42
+
43
+
44
+ # [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)
45
+
46
+
47
+ ### Bug Fixes
48
+
49
+ * **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))
50
+
51
+
52
+
53
+
54
+
55
+ # [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)
56
+
57
+
58
+ ### Bug Fixes
59
+
60
+ * **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))
61
+
62
+
63
+
64
+
65
+
66
+ # 0.1.0-alpha.50 (2022-11-17)
67
+
68
+
69
+ ### Bug Fixes
70
+
71
+ * **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))
72
+
73
+
74
+
75
+
76
+
6
77
  # [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
78
 
8
79
 
package/README.md CHANGED
@@ -1,3 +1,9 @@
1
1
  # @bonniernews/dn-design-system-web
2
2
 
3
- contains components and foundations of DN design system for web
3
+ Components and foundations of DN design system for web
4
+
5
+ Storybook: [https://designsystem.dn.se/](https://designsystem.dn.se/)
6
+
7
+ Storybook latest: [https://designsystem-latest.dn.se/](https://designsystem-latest.dn.se/)
8
+
9
+ Github: [https://github.com/BonnierNews/dn-design-system/tree/main/web/src](https://github.com/BonnierNews/dn-design-system/tree/main/web/src)
@@ -30,5 +30,5 @@ These are copy paste friendly examples to quickliy get started using a component
30
30
 
31
31
  ### SCSS
32
32
  ```scss
33
- @use "@bonniernews/dn-design-system-web/components/badge/badge.scss";
33
+ @use "@bonniernews/dn-design-system-web/components/badge/badge";
34
34
  ```
@@ -46,5 +46,5 @@ These are copy paste friendly examples to quickliy get started using a component
46
46
 
47
47
  ### SCSS
48
48
  ```scss
49
- @use "@bonniernews/dn-design-system-web/components/button/button.scss";
49
+ @use "@bonniernews/dn-design-system-web/components/button/button";
50
50
  ```
@@ -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.scss";
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) }}
@@ -137,4 +137,7 @@ $ds-checkbox__error-icon-size: 20px;
137
137
  .ds-checkbox__text {
138
138
  color: var($ds-color-text-disabled);
139
139
  }
140
+ &::before {
141
+ background-color: unset;
142
+ }
140
143
  }
@@ -28,5 +28,5 @@ These are copy paste friendly examples to quickliy get started using a component
28
28
 
29
29
  ### SCSS
30
30
  ```scss
31
- @use "@bonniernews/dn-design-system-web/components/divider/divider.scss";
31
+ @use "@bonniernews/dn-design-system-web/components/divider/divider";
32
32
  ```
@@ -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.scss";
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
- </lit>
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 }}" {{ "disabled" if params.disabled }} {{ attributes }} href="#">
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 }}" {{ "disabled" if params.disabled }} {{ attributes }}>
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 }}" {{ "disabled" if params.disabled }} {{ attributes }}>
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 }}" {{ "disabled" if params.disabled }} {{ attributes }}>
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 }}" {{ "disabled" if params.disabled }} {{ attributes }}>
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.scss";
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) }}
@@ -109,4 +109,7 @@ $ds-radio-btn__icon-size: 24px;
109
109
  .ds-radio-btn__text {
110
110
  color: var($ds-color-text-disabled);
111
111
  }
112
+ &::before {
113
+ background-color: unset;
114
+ }
112
115
  }
@@ -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/switch/switch.scss";
41
+ @use "@bonniernews/dn-design-system-web/components/switch/switch";
42
42
  ```
@@ -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.scss";
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.scss";
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
- Can be included through *Sass mixin*, example:
8
- ```css
9
- @use "@bonniernews/dn-design-system-web/foundations/helpers/typography.scss" as *;
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
- @include ds-typography($ds-typography-functional-body01regular);
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
- ```javascript
25
- {% from '@bonniernews/dn-design-system-web/foundations/typography/typography.njk' import Typography %}
14
+ ### SCSS
15
+ ```scss
16
+ @use "@bonniernews/dn-design-system-web/foundations/helpers/typography" as *;
26
17
 
27
- {{ Typography({
28
- text: text,
29
- textColor: textColor,
30
- textComponent: textComponent
31
- })}}
18
+ @include ds-typography($ds-typography-functional-body01regular);
32
19
  ```
33
20
 
34
- Or added directly through *class*.
35
-
36
- ```html
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.49",
3
+ "version": "0.1.0-alpha.56",
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",