Theming API: Refactor on ThemeUtils

pull/5507/head
mertsincan 2024-03-27 13:13:42 +00:00
parent 1953103161
commit f937fc499d
1 changed files with 6 additions and 10 deletions

View File

@ -56,18 +56,14 @@ export default {
const dark_css = SharedUtils.object.isNotEmpty(dark) ? this._toVariables({ dark }, options).declarations : ''; const dark_css = SharedUtils.object.isNotEmpty(dark) ? this._toVariables({ dark }, options).declarations : '';
primitive_css = this._transformCSS(name, prim_css, 'light', 'variable', options, set, defaults); primitive_css = this._transformCSS(name, prim_css, 'light', 'variable', options, set, defaults);
semantic_css = `${this._transformCSS(name, `${sRest_css}${csRest_css}color-scheme:light`, 'light', 'variable', options, set, defaults)}${this._transformCSS(
name, const semantic_light_css = this._transformCSS(name, `${sRest_css}${csRest_css}color-scheme:light`, 'light', 'variable', options, set, defaults);
`${dark_css}color-scheme:dark`, const semantic_dark_css = this._transformCSS(name, `${dark_css}color-scheme:dark`, 'dark', 'variable', options, set, defaults);
'dark',
'variable', semantic_css = `${semantic_light_css}${semantic_dark_css}`;
options,
set,
defaults
)}`;
} }
global_css = SharedUtils.object.getItemValue(base?.components?.global?.css, { ...params, dt: (tokenPath, type) => dt(theme, tokenPath, type) }); global_css = SharedUtils.object.getItemValue(base?.global?.css, { ...params, dt: (tokenPath, type) => dt(theme, tokenPath, type) });
return { return {
primitive: primitive_css, primitive: primitive_css,