[Enhancement] [color-picker] 支持选择 CSS 变量 #16616
Lionad-Morotar
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Feature type:
Enhancement
Details
color-picker
Description
系统中定义了一些颜色值的 CSS 变量,如:
--color-1: red
。使用 el-color-picker 选择颜色时不容易与这些 CSS 变量交互,需要在 el-color-picker 的基础上二次封装。是否能内置支持一下与 CSS 颜色变量的交互,如:
trap-css-vars
属性,开启后:trap-css-vars
属性允许传入 CSS 变量(变量名及默认值数组,type CssVar = { name: '--color-1', defaultValue: 'red' }
),color-format
支持传入数组,并增加css-variable
枚举项v-model
绑定的值按照color-format
数组顺序进行格式化,匹配到css-variable
时,如果modelValue
与trap-css-vars
数组项匹配(默认匹配逻辑为 rgba 相等),则返回对应项predefine
属性允许传入 CSS 变量color-format-check
属性((a: string | CssVar, b: string | CssVar) => boolean
),当color-format
属性为数组时用于判断是否匹配Additional comments
(empty)
0 votes ·
Beta Was this translation helpful? Give feedback.
All reactions