@bonniernews/dn-design-system-web 0.1.0-alpha.2 → 0.1.0-alpha.9

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/components/button/README.md +12 -8
  3. package/components/button/button.njk +5 -1
  4. package/components/button/button.scss +44 -27
  5. package/components/button-group/button-group.scss +11 -16
  6. package/components/hyperlink/README.md +15 -0
  7. package/components/hyperlink/hyperlink.njk +12 -4
  8. package/components/hyperlink/hyperlink.scss +1 -9
  9. package/components/icon-button/README.md +4 -3
  10. package/components/icon-button/icon-button.scss +43 -16
  11. package/foundations/colors.scss +5 -5
  12. package/foundations/helpers/mediaQueries.scss +62 -0
  13. package/foundations/helpers/typography.scss +134 -0
  14. package/foundations/icons/icon-sprite.svg +1 -1
  15. package/foundations/icons/icon.njk +40 -0
  16. package/foundations/icons/svg/add.svg +8 -0
  17. package/foundations/icons/svg/celebration.svg +8 -0
  18. package/foundations/icons/svg/info-filled.svg +8 -0
  19. package/foundations/icons/svg/lock.svg +8 -0
  20. package/foundations/icons/svg/mark_email_unread.svg +8 -0
  21. package/foundations/icons/svg/menu-filled.svg +8 -0
  22. package/foundations/icons/svg/more_horiz.svg +8 -0
  23. package/foundations/icons/svg/search.svg +8 -0
  24. package/foundations/typography/README.md +27 -0
  25. package/foundations/typography/typography.njk +15 -0
  26. package/foundations/typography/typography.scss +11 -0
  27. package/foundations/variables/colorsDnDarkTokens.scss +49 -0
  28. package/foundations/variables/colorsDnLight.scss +1 -1
  29. package/foundations/variables/colorsDnLightTokens.scss +49 -0
  30. package/foundations/variables/typography.scss +7 -0
  31. package/foundations/variables/typographyTokensScreenLarge.scss +197 -0
  32. package/foundations/variables/typographyTokensScreenSmall.scss +197 -0
  33. package/package.json +1 -1
  34. package/components/text/text-sans.njk +0 -25
  35. package/components/text/text-sans.scss +0 -1
  36. package/foundations/fonts.scss +0 -82
  37. package/foundations/helpers/colorMap.scss +0 -15
  38. package/foundations/helpers/fontFamily.scss +0 -11
  39. package/foundations/helpers/variable.scss +0 -17
  40. package/foundations/typography-sans.scss +0 -43
package/CHANGELOG.md CHANGED
@@ -3,6 +3,74 @@
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.9 (2022-08-24)
7
+
8
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
9
+
10
+
11
+
12
+
13
+
14
+ # 0.1.0-alpha.8 (2022-08-22)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **web:** focus style only on focus-visible and use pressed design as active ([#174](https://github.com/BonnierNews/dn-design-system/issues/174)) ([503ee14](https://github.com/BonnierNews/dn-design-system/commit/503ee148593fac203ff9127e0372061ab7280df5))
20
+
21
+
22
+
23
+
24
+
25
+ # 0.1.0-alpha.7 (2022-08-19)
26
+
27
+
28
+ ### Features
29
+
30
+ * **app:** add input field component ([#156](https://github.com/BonnierNews/dn-design-system/issues/156)) ([be8231c](https://github.com/BonnierNews/dn-design-system/commit/be8231c4b0b9b707eda5384bfc462c5f4e787b32))
31
+
32
+
33
+
34
+
35
+
36
+ # 0.1.0-alpha.6 (2022-08-18)
37
+
38
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
39
+
40
+
41
+
42
+
43
+
44
+ # 0.1.0-alpha.5 (2022-08-15)
45
+
46
+
47
+ ### Features
48
+
49
+ * **web:** add option for full-width on mobile for buttons ([#162](https://github.com/BonnierNews/dn-design-system/issues/162)) ([845a187](https://github.com/BonnierNews/dn-design-system/commit/845a187132a5976a804a86b2561fbbdbf5ee81fa))
50
+
51
+
52
+
53
+
54
+
55
+ # [0.1.0-alpha.4](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@0.1.0-alpha.3...@bonniernews/dn-design-system-web@0.1.0-alpha.4) (2022-08-08)
56
+
57
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
58
+
59
+
60
+
61
+
62
+
63
+ # 0.1.0-alpha.3 (2022-08-04)
64
+
65
+
66
+ ### Features
67
+
68
+ * **core:** add info icon ([#157](https://github.com/BonnierNews/dn-design-system/issues/157)) ([fa62ae1](https://github.com/BonnierNews/dn-design-system/commit/fa62ae15901bfe87d5dfcaa0db0d70e107ccd0ed))
69
+
70
+
71
+
72
+
73
+
6
74
  # 0.1.0-alpha.2 (2022-07-01)
7
75
 
8
76
  **Note:** Version bump only for package @bonniernews/dn-design-system-web
@@ -1,22 +1,26 @@
1
- ### @bonniernews/dn-design-system-web/components/button/README.md
1
+ **@bonniernews/dn-design-system-web/components/button/README.md**
2
2
 
3
3
  ----
4
4
 
5
- #### **Some sample documentation for a component**
5
+ # Button
6
6
 
7
- Here we can document **technical details** and for example list parameters not available in storybook but used in the *real world*.
7
+ Parameters available but not used in storybook:
8
8
 
9
9
  ```javascript
10
- /* Additional available parameters */
11
10
  attributes: {
12
11
  "data-test": "12345"
13
12
  },
14
13
  classNames: "my-special-class",
15
- href: "https://designsystem-latest.dn.se/" // if you add href parameter the button will rendered as an <a>
16
- type: "submit"
14
+ href: "https://designsystem-latest.dn.se/"
15
+ type: "submit",
16
+ mobile: {
17
+ fullWidth: true
18
+ }
17
19
  ```
18
20
 
19
- We could also link to places where the component is/will be implemented
21
+ ℹ️ If you add href parameter the button will be rendered as an `<a>`
20
22
 
21
- #### 🧐 See it in the wild:
23
+ ----
24
+
25
+ # 🧐 See it in the wild:
22
26
  - [DN Skola prenumeration](https://prenumerera.dn.se/skolor/)
@@ -26,6 +26,10 @@
26
26
  {% set variant = (variant.push(classNamePrefix + "full-width"), variant) %}
27
27
  {% endif %}
28
28
 
29
+ {% if params.mobile and params.mobile.fullWidth %}
30
+ {% set variant = (variant.push(classNamePrefix + "mobile-full-width"), variant) %}
31
+ {% endif %}
32
+
29
33
  {% if params.iconName and params.iconPosition and params.iconPosition != "none" %}
30
34
  {% set iconName = params.iconName | lower %}
31
35
  {% set variant = (variant.push(classNamePrefix + "icon" + "-" + params.iconPosition ), variant) %}
@@ -41,6 +45,6 @@
41
45
  {% if params.href %}
42
46
  <a href="{{ params.href | default('#', true) }}" class="{{ classes }}" {{ attributes }}>{{ text }}{{- iconSvg | safe if iconSvg -}}</a>
43
47
  {% else %}
44
- <button type="{{ type | default('button') }}" class="{{ classes }}" {{ "disabled" if isDisabled }} {{ attributes }}>{{ text }}{{- iconSvg | safe if iconSvg -}}</button>
48
+ <button type="{{ params.type | default('button') }}" class="{{ classes }}" {{ "disabled" if isDisabled }} {{ attributes }}>{{ text }}{{- iconSvg | safe if iconSvg -}}</button>
45
49
  {% endif %}
46
50
  {% endmacro %}
@@ -1,6 +1,6 @@
1
1
  @use "../../foundations/helpers/spacing.scss" as *;
2
- @use "../../foundations/helpers/variable.scss" as *;
3
- @use "../../foundations/helpers/fontFamily.scss" as *;
2
+ @use "../../foundations/helpers/typography.scss" as *;
3
+ @use "../../foundations/helpers/mediaQueries.scss" as *;
4
4
  @use "../../foundations/variables/colorsDnLight" as *;
5
5
 
6
6
  // Temporary variables we maybe should handle in a better way
@@ -8,6 +8,12 @@ $ds-btn__border-radius: 2px;
8
8
  $ds-btn__border-width--outlined: 1px;
9
9
  $ds-btn__outline-width: 2px;
10
10
 
11
+ @mixin ds-btn-disabled() {
12
+ background-color: var(--ds-action-disabled);
13
+ color: var(--ds-text-disabled);
14
+ outline: none;
15
+ }
16
+
11
17
  .ds-btn {
12
18
  @include ds-font-sans();
13
19
  cursor: pointer;
@@ -21,11 +27,11 @@ $ds-btn__outline-width: 2px;
21
27
  transition: background-color 50ms ease-out;
22
28
  padding: ds-spacing(1.5 3);
23
29
 
24
- &:focus {
30
+ &:focus-visible {
25
31
  outline-offset: 2px;
26
32
  }
27
33
  &:disabled {
28
- outline: none;
34
+ @include ds-btn-disabled;
29
35
  }
30
36
 
31
37
  @at-root a#{&} {
@@ -50,6 +56,12 @@ $ds-btn__outline-width: 2px;
50
56
  }
51
57
  }
52
58
 
59
+ @include ds-mq-only-breakpoint(mobile) {
60
+ .ds-btn--mobile-full-width {
61
+ width: 100%;
62
+ }
63
+ }
64
+
53
65
  .ds-btn--icon-left,
54
66
  .ds-btn--icon-right {
55
67
  display: inline-flex;
@@ -78,13 +90,14 @@ $ds-btn__outline-width: 2px;
78
90
  &:hover {
79
91
  background-color: var(--ds-action-brand-hover);
80
92
  }
81
- &:focus {
93
+ &:focus-visible {
82
94
  outline: $ds-btn__outline-width solid var(--ds-border-brand-default);
83
95
  }
96
+ &:active {
97
+ background-color: var(--ds-action-brand-pressed);
98
+ }
84
99
  &:disabled {
85
- background-color: var(--ds-action-brand-disabled);
86
- color: var(--ds-text-primary-disabled);
87
- outline: none;
100
+ @include ds-btn-disabled;
88
101
  }
89
102
  }
90
103
 
@@ -94,13 +107,14 @@ $ds-btn__outline-width: 2px;
94
107
  &:hover {
95
108
  background-color: var(--ds-action-business-hover);
96
109
  }
97
- &:focus {
110
+ &:focus-visible {
98
111
  outline: $ds-btn__outline-width solid var(--ds-border-business-default);
99
112
  }
113
+ &:active {
114
+ background-color: var(--ds-action-business-pressed);
115
+ }
100
116
  &:disabled {
101
- background-color: var(--ds-action-business-disabled);
102
- color: var(--ds-text-primary-disabled);
103
- outline: none;
117
+ @include ds-btn-disabled;
104
118
  }
105
119
  }
106
120
 
@@ -110,13 +124,14 @@ $ds-btn__outline-width: 2px;
110
124
  &:hover {
111
125
  background-color: var(--ds-action-primary-hover);
112
126
  }
113
- &:focus {
127
+ &:focus-visible {
114
128
  outline: $ds-btn__outline-width solid var(--ds-border-primary-strong);
115
129
  }
130
+ &:active {
131
+ background-color: var(--ds-action-primary-pressed);
132
+ }
116
133
  &:disabled {
117
- background-color: var(--ds-action-primary-disabled);
118
- color: var(--ds-text-primary-disabled);
119
- outline: none;
134
+ @include ds-btn-disabled;
120
135
  }
121
136
  }
122
137
 
@@ -127,14 +142,15 @@ $ds-btn__outline-width: 2px;
127
142
  &:hover {
128
143
  background-color: var(--ds-action-secondary-hover);
129
144
  }
130
- &:focus {
145
+ &:focus-visible {
131
146
  outline: $ds-btn__outline-width solid var(--ds-border-primary-strong);
132
147
  }
148
+ &:active {
149
+ background-color: var(--ds-action-secondary-pressed);
150
+ }
133
151
  &:disabled {
134
- background-color: var(--ds-action-secondary-disabled);
135
- border-color: var(--ds-action-secondary-disabled);
136
- color: var(--ds-text-primary-disabled);
137
- outline: none;
152
+ @include ds-btn-disabled;
153
+ border-color: var(--ds-action-disabled);
138
154
  }
139
155
  }
140
156
 
@@ -143,15 +159,16 @@ $ds-btn__outline-width: 2px;
143
159
  border: $ds-btn__border-width--outlined solid var(--ds-border-critical-default);
144
160
  color: var(--ds-text-critical-default);
145
161
  &:hover {
146
- background-color: var(--ds-action-critical-hover);
162
+ background-color: var(--ds-surface-critical-default);
147
163
  }
148
- &:focus {
164
+ &:focus-visible {
149
165
  outline: $ds-btn__outline-width solid var(--ds-border-primary-strong);
150
166
  }
167
+ &:active {
168
+ background-color: var(--ds-surface-critical-default);
169
+ }
151
170
  &:disabled {
152
- background-color: var(--ds-action-secondary-disabled);
153
- border-color: var(--ds-action-secondary-disabled);
154
- color: var(--ds-text-primary-disabled);
155
- outline: none;
171
+ @include ds-btn-disabled;
172
+ border-color: var(--ds-action-disabled);
156
173
  }
157
174
  }
@@ -1,25 +1,20 @@
1
1
  @use "../../foundations/helpers/spacing.scss" as *;
2
+ @use "../../foundations/helpers/mediaQueries.scss" as *;
2
3
  @use "../button/button.scss" as *;
3
4
 
4
- @mixin ds-btn-group-screen-l {
5
- flex-direction: column;
6
-
7
- .ds-btn:first-of-type {
8
- margin: ds-spacing(0 0 1 0);
9
- }
10
- }
11
-
12
5
  .ds-btn-group {
13
6
  display: flex;
14
- .ds-btn:first-of-type {
15
- margin: ds-spacing(0 1 0 0);
7
+
8
+ @include ds-mq-largest-breakpoint(mobile) {
9
+ flex-direction: column;
10
+ .ds-btn:first-of-type {
11
+ margin: ds-spacing(0 0 1 0);
12
+ }
16
13
  }
17
- }
18
14
 
19
- // @todo refactor when media queries are in place
20
- // remeber to keep large screen toggle in storybook working along side media queries
21
- .ds-screen-l {
22
- .ds-btn-group {
23
- @include ds-btn-group-screen-l;
15
+ @include ds-mq-smallest-breakpoint(tablet) {
16
+ .ds-btn:first-of-type {
17
+ margin: ds-spacing(0 1 0 0);
18
+ }
24
19
  }
25
20
  }
@@ -0,0 +1,15 @@
1
+ **@bonniernews/dn-design-system-web/components/hyperlink/README.md**
2
+
3
+ ----
4
+
5
+ # Hyperlink
6
+
7
+ Parameters available but not used in storybook:
8
+
9
+ ```javascript
10
+ attributes: {
11
+ "data-test": "12345"
12
+ },
13
+ classNames: "my-special-class",
14
+ href: "https://designsystem-latest.dn.se/"
15
+ ```
@@ -1,8 +1,16 @@
1
1
  {% macro Hyperlink(params) %}
2
- {% set componentClassName = "ds-hyperlink" %}
3
- {% set classNamePrefix = componentClassName + "--" %}
4
2
  {% set variant = [] %}
5
3
 
4
+ {% set attributes %}
5
+ {% for attribute, value in params.attributes %}
6
+ {{attribute}}={{value}}
7
+ {% endfor %}
8
+ {% endset %}
9
+
10
+ {% if params.textComponent %}
11
+ {% set variant = (variant.push('ds-t-' + params.textComponent), variant) %}
12
+ {% endif %}
13
+
6
14
  {% if params.textColor %}
7
15
  {% set variant = (variant.push("ds-color-text-" + params.textColor), variant) %}
8
16
  {% endif %}
@@ -11,7 +19,7 @@
11
19
  {% set variant = (variant.push(params.classNames), variant) %}
12
20
  {% endif%}
13
21
 
14
- {% set classes = componentClassName + " " + variant | join(" ") %}
22
+ {% set classes = variant | join(" ") %}
15
23
 
16
- <a href="{{ params.href | default('#', true) }}" class="{{ classes }}">{{ params.text }}</a>
24
+ <a href="{{ params.href | default('#', true) }}" class="{{ classes }}" {{ attributes }}>{{ params.text }}</a>
17
25
  {% endmacro %}
@@ -1,9 +1 @@
1
- @use "../../foundations/typography-sans.scss" as *;
2
-
3
- .ds-hyperlink {
4
- text-decoration: underline;
5
-
6
- &:hover {
7
- text-decoration: none;
8
- }
9
- }
1
+ @use "../../foundations/typography/typography.scss";
@@ -4,13 +4,14 @@
4
4
 
5
5
  # Icon button
6
6
 
7
- Parameters not available in storybook but used in the *real world*.
7
+ Parameters available but not used in storybook:
8
8
 
9
9
  ```javascript
10
- /* Additional available parameters */
11
10
  attributes: {
12
11
  "data-test": "12345"
13
12
  },
14
13
  classNames: "my-special-class",
15
- href: "https://designsystem-latest.dn.se/" // if you add href parameter the button will rendered as an <a>
14
+ href: "https://designsystem-latest.dn.se/"
16
15
  ```
16
+
17
+ ℹ️ If you add href parameter the button will be rendered as an `<a>`
@@ -1,8 +1,13 @@
1
1
  @use "../../foundations/helpers/spacing.scss" as *;
2
- @use "../../foundations/helpers/variable.scss" as *;
3
- @use "../../foundations/helpers/fontFamily.scss" as *;
2
+ @use "../../foundations/helpers/typography.scss" as *;
4
3
  @use "../../foundations/variables/colorsDnLight" as *;
5
4
 
5
+ // @todo when these exists as tokens, change to tokens and switch to css variables
6
+ $ds-action-overlay-default: rgba(13, 13, 13, 0.1);
7
+ $ds-action-overlay-hover: rgba(13, 13, 13, 0.15);
8
+ $ds-action-overlay-pressed: rgba(13, 13, 13, 0.15);
9
+ $ds-action-transparent-default: transparent;
10
+
6
11
  // Temporary variables we maybe should handle in a better way
7
12
  $ds-icon-btn__border-radius: 100px;
8
13
  $ds-icon-btn__border-width--outlined: 1px;
@@ -36,7 +41,7 @@ $ds-icon-btn__icon-size--s: 20px;
36
41
  }
37
42
  }
38
43
 
39
- &:focus {
44
+ &:focus-visible {
40
45
  outline-offset: 2px;
41
46
  }
42
47
  &:disabled {
@@ -63,31 +68,50 @@ $ds-icon-btn__icon-size--s: 20px;
63
68
  }
64
69
 
65
70
  .ds-icon-btn--transparent {
66
- background-color: transparent;
71
+ background-color: $ds-action-transparent-default; // todo remove fallbak when token exists
72
+ // background-color: var(--ds-action-transparent-default);
67
73
  color: var(--ds-icon-primary-default);
68
74
  &:hover {
69
- background-color: var(--ds-action-overlay-hover);
75
+ background-color: $ds-action-overlay-hover; // todo remove fallbak when token exists
76
+ // background-color: var(--ds-action-overlay-hover);
70
77
  }
71
- &:focus {
78
+ &:focus-visible {
72
79
  outline: $ds-icon-btn__outline-width solid var(--ds-border-primary-strong);
80
+ background-color: var(--ds-action-secondary-default);
81
+ }
82
+ &:active {
83
+ background-color: $ds-action-overlay-pressed; // todo remove fallbak when token exists
84
+ // background-color: var(--ds-action-overlay-pressed);
85
+ border: $ds-icon-btn__border-width--outlined solid var(--ds-border-primary-strong);
73
86
  }
74
87
  &:disabled {
75
- color: var(--ds-icon-primary-disabled);
88
+ background-color: $ds-action-transparent-default; // todo remove fallbak when token exists
89
+ // background-color: var(--ds-action-transparent-default);
90
+ color: var(--ds-icon-disabled);
76
91
  outline: none;
77
92
  }
78
93
  }
79
94
 
80
95
  .ds-icon-btn--overlay {
81
- background-color: var(--ds-action-overlay-default);
96
+ background-color: $ds-action-overlay-default; // todo remove fallbak when token exists
97
+ // background-color: var(--ds-action-overlay-default);
82
98
  color: var(--ds-icon-primary-default);
83
99
  &:hover {
84
- background-color: var(--ds-action-overlay-hover);
100
+ background-color: $ds-action-overlay-hover; // todo remove fallbak when token exists
101
+ // background-color: var(--ds-action-overlay-hover);
85
102
  }
86
- &:focus {
103
+ &:focus-visible {
87
104
  outline: $ds-icon-btn__outline-width solid var(--ds-border-primary-strong);
88
105
  }
106
+ &:active {
107
+ background-color: $ds-action-overlay-pressed; // todo remove fallbak when token exists
108
+ // background-color: var(--ds-action-overlay-pressed);
109
+ border: $ds-icon-btn__border-width--outlined solid var(--ds-border-primary-strong);
110
+ }
89
111
  &:disabled {
90
- color: var(--ds-icon-primary-disabled);
112
+ background-color: $ds-action-overlay-default; // todo remove fallbak when token exists
113
+ // background-color: var(--ds-action-overlay-default);
114
+ color: var(--ds-icon-disabled);
91
115
  outline: none;
92
116
  }
93
117
  }
@@ -99,14 +123,17 @@ $ds-icon-btn__icon-size--s: 20px;
99
123
  &:hover {
100
124
  background-color: var(--ds-action-secondary-hover);
101
125
  }
102
- &:focus {
103
- outline: $ds-icon-btn__outline-width solid $ds-border-primary-strong;
104
- outline-color: var(--ds-border-primary-strong);
126
+ &:focus-visible {
127
+ outline: $ds-icon-btn__outline-width solid var(--ds-border-primary-strong);
128
+ }
129
+ &:active {
130
+ background-color: var(--ds-action-secondary-pressed);
131
+ border-color: var(--ds-border-primary-strong);
105
132
  }
106
133
  &:disabled {
107
134
  border: none;
108
- background-color: var(--ds-action-secondary-disabled);
109
- color: var(--ds-icon-primary-disabled);
135
+ background-color: var(--ds-action-disabled);
136
+ color: var(--ds-icon-disabled);
110
137
  outline: none;
111
138
  }
112
139
  }
@@ -1,10 +1,10 @@
1
1
  @use 'sass:meta';
2
2
  @use 'sass:string';
3
- @use './variables/colorsDnLight';
4
- @use './variables/colorsDnDark';
3
+ @use './variables/colorsDnLightTokens';
4
+ @use './variables/colorsDnDarkTokens';
5
5
 
6
6
  html {
7
- @each $name, $value in meta.module-variables("colorsDnLight") {
7
+ @each $name, $value in meta.module-variables("colorsDnLightTokens") {
8
8
  --#{$name}: #{$value};
9
9
  }
10
10
 
@@ -17,7 +17,7 @@ html {
17
17
  // }
18
18
  }
19
19
 
20
- @each $name, $value in meta.module-variables("colorsDnLight") {
20
+ @each $name, $value in meta.module-variables("colorsDnLightTokens") {
21
21
  .ds-color-#{string.slice($name, 4)} {
22
22
  color: var(--#{$name});
23
23
  }
@@ -25,7 +25,7 @@ html {
25
25
 
26
26
  // for manually switching on dark mode, for exemple used when switching theme in storybook
27
27
  .dnDark {
28
- @each $name, $value in meta.module-variables("colorsDnDark") {
28
+ @each $name, $value in meta.module-variables("colorsDnDarkTokens") {
29
29
  --ds-#{string.slice($name, 9)}: #{$value};
30
30
  }
31
31
  }
@@ -0,0 +1,62 @@
1
+ @use 'sass:map';
2
+
3
+ $ds-mq-min-width--desktop: 1025;
4
+ $ds-mq-min-width--tablet: 768;
5
+
6
+ $ds-breakpoints: (
7
+ "desktop": (
8
+ "min-width": $ds-mq-min-width--desktop
9
+ ),
10
+ "tablet": (
11
+ "min-width": $ds-mq-min-width--tablet,
12
+ "max-width": $ds-mq-min-width--desktop - 1
13
+ ),
14
+ "mobile": (
15
+ "max-width": $ds-mq-min-width--tablet - 1
16
+ )
17
+ );
18
+
19
+ @mixin ds-mq-smallest-breakpoint($breakpoint) {
20
+ $min: map-get($ds-breakpoints, $breakpoint, "min-width");
21
+ @if $min {
22
+ @media (min-width: ds-px($min)) {
23
+ @content;
24
+ }
25
+ }
26
+ }
27
+
28
+ @mixin ds-mq-largest-breakpoint($breakpoint) {
29
+ $max: map-get($ds-breakpoints, $breakpoint, "max-width");
30
+ @if $max {
31
+ @media (max-width: ds-px($max)) {
32
+ @content;
33
+ }
34
+ }
35
+ }
36
+
37
+ @mixin ds-mq-only-breakpoint($breakpoint) {
38
+ $min: map-get($ds-breakpoints, $breakpoint, "min-width");
39
+ $max: map-get($ds-breakpoints, $breakpoint, "max-width");
40
+
41
+ @if $min and $max {
42
+ @media (min-width: ds-px($min)) and (max-width: ds-px($max)) {
43
+ @content;
44
+ }
45
+ } @else if $min {
46
+ @media (min-width: ds-px($min)) {
47
+ @content;
48
+ }
49
+ } @else if $max {
50
+ @media (max-width: ds-px($max)) {
51
+ @content;
52
+ }
53
+ }
54
+ }
55
+
56
+ @function ds-px($n) {
57
+ @if $n {
58
+ @return $n * 1px;
59
+ }
60
+
61
+ @return $n;
62
+ }