Theming API: Added fallback param to inline dt method.

This commit is contained in:
mertsincan 2024-03-28 13:01:28 +00:00
parent c25b2e0559
commit 468106cfb8
3 changed files with 8 additions and 8 deletions

View file

@ -63,7 +63,7 @@ export default {
semantic_css = `${semantic_light_css}${semantic_dark_css}`;
}
global_css = SharedUtils.object.getItemValue(base?.global?.css, { ...params, dt: (tokenPath, type) => dt(theme, tokenPath, type) });
global_css = SharedUtils.object.getItemValue(base?.global?.css, { ...params, dt: (tokenPath, fallback, type) => dt(theme, tokenPath, fallback, type) });
return {
primitive: primitive_css,
@ -84,7 +84,7 @@ export default {
getBaseC({ name = '', theme = {}, params, set, defaults }) {
const { base, options } = theme;
const { css } = base?.components?.[name] || {};
const computed_css = SharedUtils.object.getItemValue(css, { ...params, dt: (tokenPath, type) => dt(theme, tokenPath, type) });
const computed_css = SharedUtils.object.getItemValue(css, { ...params, dt: (tokenPath, fallback, type) => dt(theme, tokenPath, fallback, type) });
return this._transformCSS(name, computed_css, undefined, 'style', options, set, defaults);
},
@ -101,7 +101,7 @@ export default {
getBaseD({ name = '', theme = {}, params, set, defaults }) {
const { base, options } = theme;
const { css } = base?.directives?.[name] || {};
const computed_css = SharedUtils.object.getItemValue(css, { ...params, dt: (tokenPath, type) => dt(theme, tokenPath, type) });
const computed_css = SharedUtils.object.getItemValue(css, { ...params, dt: (tokenPath, fallback, type) => dt(theme, tokenPath, fallback, type) });
return this._transformCSS(name, computed_css, undefined, 'style', options, set, defaults);
},