This commit is contained in:
2026-05-07 02:15:20 +08:00
parent da0a6d0f81
commit ccc46844b6
141 changed files with 2358 additions and 1661 deletions

View 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 是 prefixvalue 是完整 class。
// prefix 用正则来获取,先检测是否包含前缀,再检测这个前缀是否在开头,再检测前缀后面是否跟着“-”(就怕匹配到首字母)
// 用正则套壳花括号注入前缀。正则要求1在开头在尾部跟着“-”或者“没有其他字符”
// const reg = new RegExp(`^${prefix}(?:-|$)`);
// class如果一次匹配2个prefix那么就采用较长的那个prefix因为这种情况肯定是“较短子字符串”的副作用