Unocss
Unocss
export default defineConfig({ shortcuts: [ ['root', 'selector-[:root]:[--varname:200,0,0]'] ], theme: { colors: { // ... 'veryCool': '#0000ff', 'mainColor': 'rgb(253, 230, 139)', 'cv': 'rgb(var(--varname))' }, container: { center: true, } }, }
  • 这个配置,varname 不生效
  • mainColor 写成 main-color 不生效,可能不支持 kebab-case

According to the provided configuration, Unocss does not support camelCase custom color names. The custom color name 'mainColor' should be written in kebab-case as 'main-color' instead. Additionally, the variable 'varname' is not working as expected in this configuration.