@bonniernews/dn-design-system-web 27.0.0 → 27.0.1

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
@@ -4,6 +4,13 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
4
4
 
5
5
 
6
6
 
7
+ ## [27.0.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@27.0.0...@bonniernews/dn-design-system-web@27.0.1) (2025-02-10)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **web:** support color scheme ([#1600](https://github.com/BonnierNews/dn-design-system/issues/1600)) ([bd35beb](https://github.com/BonnierNews/dn-design-system/commit/bd35beb28a02bbbb486869301808deb6cf800084))
13
+
7
14
  ## [27.0.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@26.0.2...@bonniernews/dn-design-system-web@27.0.0) (2025-02-09)
8
15
 
9
16
 
@@ -19,8 +19,6 @@ html.support-color-scheme:not(.ds-light) {
19
19
  }
20
20
 
21
21
  // for manually switching on dark mode
22
- // dnDark should only be used in storybook otherwise use ds-dark
23
- .dnDark,
24
22
  .ds-dark {
25
23
  @include get-dark-color-scheme();
26
24
  }
@@ -1,25 +1,18 @@
1
- @use "sass:map";
2
- @use "sass:meta";
3
1
  @use "./helpers/gradients.scss" as *;
4
- @use "./variables/gradientsDnLight";
5
- @use "./variables/gradientsDnDark";
6
2
 
7
3
  html,
8
4
  .ds-light {
9
- @each $name, $value in meta.module-variables("gradientsDnLight") {
10
- @each $key in map.keys($value) {
11
- @include ds-gradient($key, light);
12
- }
5
+ @include get-gradient-scheme();
6
+ }
7
+
8
+ // enable listening to OS dark mode by setting class support-color-scheme on html-tag
9
+ html.support-color-scheme:not(.ds-light) {
10
+ @media (prefers-color-scheme: dark) {
11
+ @include get-gradient-scheme(dark);
13
12
  }
14
13
  }
15
14
 
16
15
  // for manually switching on dark mode
17
- // dnDark should only be used in storybook otherwise use ds-dark
18
- .dnDark,
19
16
  .ds-dark {
20
- @each $name, $value in meta.module-variables("gradientsDnDark") {
21
- @each $key in map.keys($value) {
22
- @include ds-gradient($key, dark);
23
- }
24
- }
17
+ @include get-gradient-scheme(dark);
25
18
  }
@@ -31,3 +31,9 @@
31
31
  @function _get-stop($map, $key, $index) {
32
32
  @return map.get(list.nth(map.get($map, "stops"), $index), $key);
33
33
  }
34
+
35
+ @mixin get-gradient-scheme($type: light) {
36
+ @each $key in map.keys($gradientsDnLight) {
37
+ @include ds-gradient($key, $type);
38
+ }
39
+ }
@@ -27,3 +27,9 @@
27
27
  @function ds-shadow-get-box-shadow($component) {
28
28
  @return var($component);
29
29
  }
30
+
31
+ @mixin get-shadow-scheme($type: light) {
32
+ @each $key in map.keys($shadowsDnLight) {
33
+ @include ds-shadow($key, $type);
34
+ }
35
+ }
@@ -1,25 +1,18 @@
1
- @use "sass:map";
2
- @use "sass:meta";
3
1
  @use "./helpers/shadows.scss" as *;
4
- @use "./variables/shadowsDnLight";
5
- @use "./variables/shadowsDnDark";
6
2
 
7
3
  html,
8
4
  .ds-light {
9
- @each $name, $value in meta.module-variables("shadowsDnLight") {
10
- @each $key in map.keys($value) {
11
- @include ds-shadow($key, light);
12
- }
5
+ @include get-shadow-scheme();
6
+ }
7
+
8
+ // enable listening to OS dark mode by setting class support-color-scheme on html-tag
9
+ html.support-color-scheme:not(.ds-light) {
10
+ @media (prefers-color-scheme: dark) {
11
+ @include get-shadow-scheme(dark);
13
12
  }
14
13
  }
15
14
 
16
15
  // for manually switching on dark mode
17
- // dnDark should only be used in storybook otherwise use ds-dark
18
- .dnDark,
19
16
  .ds-dark {
20
- @each $name, $value in meta.module-variables("shadowsDnDark") {
21
- @each $key in map.keys($value) {
22
- @include ds-shadow($key, dark);
23
- }
24
- }
17
+ @include get-shadow-scheme(dark);
25
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "27.0.0",
3
+ "version": "27.0.1",
4
4
  "description": "DN design system for web.",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/BonnierNews/dn-design-system/tree/main/web/src#readme",