diff --git a/components/lib/base/style/BaseStyle.js b/components/lib/base/style/BaseStyle.js index 2ce05f8cd..49dd8ede4 100644 --- a/components/lib/base/style/BaseStyle.js +++ b/components/lib/base/style/BaseStyle.js @@ -203,7 +203,7 @@ export default { let css = [Theme.getStyleSheet(this.name, params, props)]; if (this.theme) { - const name = `${this.name}-style`; + const name = this.name === 'base' ? 'global-style' : `${this.name}-style`; const _css = ObjectUtils.getItemValue(this.theme, { dt }); const _style = ObjectUtils.minifyCSS(Theme.transformCSS(name, _css)); const _props = Object.entries(props) diff --git a/components/lib/themes/utils/themeUtils.js b/components/lib/themes/utils/themeUtils.js index 9a3251aeb..001f2f31c 100644 --- a/components/lib/themes/utils/themeUtils.js +++ b/components/lib/themes/utils/themeUtils.js @@ -151,12 +151,13 @@ export default { .join(''); }, getStyleSheet({ name = '', theme = {}, params, props = {}, set, defaults }) { - const presetC_css = this.getPresetC({ name, theme, params, set, defaults })?.css; + const options = { name, theme, params, set, defaults }; + const preset_css = (name.includes('-directive') ? this.getPresetD(options) : this.getPresetC(options))?.css; const _props = Object.entries(props) .reduce((acc, [k, v]) => acc.push(`${k}="${v}"`) && acc, []) .join(' '); - return presetC_css ? `` : ''; + return preset_css ? `` : ''; }, createTokens(obj = {}, defaults, parentKey = '', parentPath = '', tokens = {}) { Object.entries(obj).forEach(([key, value]) => {