arco-design / arco-plugins

Webpack / Vite plugins for Arco Design
https://arco.design
MIT License
65 stars 39 forks source link

fix(plugin-webpack-react): 修复css变量失效问题 #55

Closed sHow8e closed 10 months ago

sHow8e commented 10 months ago

Types of changes

Background and context

因为插件内部处理机制,导致token固化的缘故。

当前插件无法彻底把css变量前缀改得很彻底。

image

Solution

虽然 有 @arco-cssvars-prefix: if(@arco-vars-prefix = ~'', -, ~'--@{arco-vars-prefix}') 这种语句。

但是token在处理前值已经固化了。如果要想实现css变量的变更。使用时要配置如下才能生效

modifyVars: { prefix: 've-o', 'arco-vars-prefix': 've-o', 'arco-cssvars-prefix': '--ve-o', // 此处要显性添加 },


image

How is the change tested?

Changelog

Changelog(CN) Changelog(EN) Related issues

Checklist:

Other information