UNPKG

@opentiny/tiny-toolkit-docs

Version:

这里对你的套件进行简单描述, 比如适用哪些场景,使用了什么技术, 有什么特点

13 lines (12 loc) 437 B
// shortkey的 字典变量 const _s = { c: 'color', bg: 'background-color' }; export default function builder(option) { return { rules: [ // 颜色 #不建议使用 c-black bg-primary c#123456 [/^(c|bg)-(\w+)$/, ([, attr, color]) => ({ [`${_s[attr]}`]: `var(--${color})` })], [/^(c|bg)#(\w+)$/, ([, attr, color]) => ({ [`${_s[attr]}`]: `#${color}` })], ], shortcuts: [], }; }