@daffodil/design 0.44.0 → 0.44.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daffodil/design",
3
- "version": "0.44.0",
3
+ "version": "0.44.1",
4
4
  "author": "Graycore LLC",
5
5
  "license": "MIT",
6
6
  "bugs": {
@@ -1,8 +1,11 @@
1
1
  @use 'sass:map';
2
2
  @use '../core';
3
- @use 'theming';
3
+ @use '../theming';
4
4
 
5
- @mixin daff-root($theme) {
5
+ // @docs
6
+ //
7
+ // Global theme tokens
8
+ @mixin daff-root-theme-tokens($theme) {
6
9
  $base: core.daff-map-deep-get($theme, 'core.base');
7
10
  $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast');
8
11
  $primary: map.get($theme, primary);
@@ -26,18 +29,20 @@
26
29
  --daff-theme-white: #{$white};
27
30
  --daff-theme-black: #{$black};
28
31
  --daff-theme-gray: #{theming.daff-color($gray)};
32
+ --daff-base-background: #{$base};
33
+ --daff-base-text: #{theming.daff-text-contrast($base)};
29
34
  }
30
35
 
31
- @mixin daff-theme-css-variables($theme, $asRoot: true) {
32
- // @docs
33
- //
34
- // Global theming css variables
35
- @if ($asRoot) {
36
- :root {
37
- @include daff-root($theme);
38
- }
39
- else {
40
- @include daff-root($theme);
36
+ @mixin daff-theme-css-variables($theme) {
37
+ @each $selector in & {
38
+ $l: length($selector);
39
+
40
+ @if ($l == 1) {
41
+ :root {
42
+ @include daff-root-theme-tokens($theme);
43
+ }
44
+ } @else {
45
+ @include daff-root-theme-tokens($theme);
41
46
  }
42
47
  }
43
48
  }