mm
This commit is contained in:
42
packages/css/utils/prefix-list.ts
Normal file
42
packages/css/utils/prefix-list.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
export const defaultPrefixList = [
|
||||
"align-content",
|
||||
"items",
|
||||
"align-self",
|
||||
"animate",
|
||||
"rounded",
|
||||
"box-decoration",
|
||||
"break-inside",
|
||||
"box-sizing",
|
||||
"brand",
|
||||
"break-after",
|
||||
"break-before",
|
||||
"cursor",
|
||||
"display",
|
||||
"flex-direction",
|
||||
"flex-wrap",
|
||||
"font-family",
|
||||
"font-weight",
|
||||
"text",
|
||||
"gap",
|
||||
"h",
|
||||
"justify",
|
||||
"justify-items",
|
||||
"justify-self",
|
||||
"mx",
|
||||
"my",
|
||||
"px",
|
||||
"py",
|
||||
"overflow",
|
||||
"overscroll",
|
||||
"position",
|
||||
"sr",
|
||||
"theme",
|
||||
"w",
|
||||
"z",
|
||||
];
|
||||
|
||||
// map 里面 key 是 prefix,value 是完整 class。
|
||||
// prefix 用正则来获取,先检测是否包含前缀,再检测这个前缀是否在开头,再检测前缀后面是否跟着“-”(就怕匹配到首字母)
|
||||
// 用正则套壳,花括号注入前缀。正则要求1,在开头,在尾部跟着“-”或者“没有其他字符”
|
||||
// const reg = new RegExp(`^${prefix}(?:-|$)`);
|
||||
// class如果一次匹配2个prefix,那么就采用较长的那个prefix,因为这种情况肯定是“较短子字符串”的副作用
|
||||
Reference in New Issue
Block a user