@@ -20,7 +20,10 @@ $enable-css-custom-properties: feature-flag-enabled(
2020/// @example get-token-value($component-tokens, 'tag-background-red');
2121/// @returns {String} Token value
2222/// @group component-tokens
23- @function get-token-value ($tokens , $name ) {
23+ @function get-token-value ($tokens , $name , $force-static-values : false ) {
24+ $emit-as-css-custom-property : $force-static-values == false and
25+ feature-flag-enabled (' enable-css-custom-properties' );
26+
2427 @if map-has-key ($tokens , $name ) {
2528 $config : map-get ($tokens , $name );
2629 $fallback : map-get ($config , ' fallback' );
@@ -33,15 +36,15 @@ $enable-css-custom-properties: feature-flag-enabled(
3336 $value : map-get ($option , ' value' );
3437
3538 @return if (
36- feature-flag-enabled ( ' enable- css-custom-properties ' ) ,
39+ $emit-as- css-custom-property ,
3740 var (--#{$custom-property-prefix}-#{$name} , #{$value } ),
3841 $value
3942 );
4043 }
4144 }
4245
4346 @return if (
44- feature-flag-enabled ( ' enable- css-custom-properties ' ) ,
47+ $emit-as- css-custom-property ,
4548 var (--#{$custom-property-prefix}-#{$name} , #{$fallback } ),
4649 $fallback
4750 );
@@ -73,6 +76,6 @@ $enable-css-custom-properties: feature-flag-enabled(
7376/// @example @include emit-component-tokens($component-tokens);
7477@mixin emit-component-tokens ($tokens ) {
7578 @each $key , $options in $tokens {
76- @include custom-property ($key , get-token-value ($tokens , $key ));
79+ @include custom-property ($key , get-token-value ($tokens , $key , true ));
7780 }
7881}
0 commit comments