mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-11 04:22:54 +00:00
1
This commit is contained in:
parent
807c8c50ae
commit
dabc910075
14
packages/vite-plugin/dist/index.js
vendored
14
packages/vite-plugin/dist/index.js
vendored
@ -1750,6 +1750,7 @@ if (typeof window !== 'undefined') {
|
||||
},
|
||||
// 处理声明规则
|
||||
Declaration(decl) {
|
||||
const className = decl.parent.selector || "";
|
||||
// 处理 Tailwind 自定义属性
|
||||
if (decl.prop.includes("--tw-")) {
|
||||
colorValues[decl.prop] = decl.value.includes("rem")
|
||||
@ -1766,7 +1767,7 @@ if (typeof window !== 'undefined') {
|
||||
// 处理文本大小相关样式
|
||||
if (decl.value.includes("rpx") &&
|
||||
decl.prop == "color" &&
|
||||
decl.parent.selector?.includes("text-")) {
|
||||
className.includes("text-")) {
|
||||
decl.prop = "font-size";
|
||||
}
|
||||
// 删除不支持的属性
|
||||
@ -1780,6 +1781,17 @@ if (typeof window !== 'undefined') {
|
||||
decl.value = "1";
|
||||
}
|
||||
}
|
||||
// 处理 visibility 属性
|
||||
if (decl.prop == "visibility") {
|
||||
decl.remove();
|
||||
}
|
||||
// 处理 sticky 属性
|
||||
if (className == ".sticky") {
|
||||
if (decl.prop == "position" ||
|
||||
decl.value == "sticky") {
|
||||
decl.remove();
|
||||
}
|
||||
}
|
||||
// 解析声明值
|
||||
const parsed = valueParser(decl.value);
|
||||
let hasChanges = false;
|
||||
|
||||
@ -134,6 +134,8 @@ function postcssPlugin(): Plugin {
|
||||
|
||||
// 处理声明规则
|
||||
Declaration(decl: any) {
|
||||
const className = decl.parent.selector || "";
|
||||
|
||||
// 处理 Tailwind 自定义属性
|
||||
if (decl.prop.includes("--tw-")) {
|
||||
colorValues[decl.prop] = decl.value.includes("rem")
|
||||
@ -155,7 +157,7 @@ function postcssPlugin(): Plugin {
|
||||
if (
|
||||
decl.value.includes("rpx") &&
|
||||
decl.prop == "color" &&
|
||||
decl.parent.selector?.includes("text-")
|
||||
className.includes("text-")
|
||||
) {
|
||||
decl.prop = "font-size";
|
||||
}
|
||||
@ -178,6 +180,16 @@ function postcssPlugin(): Plugin {
|
||||
decl.remove();
|
||||
}
|
||||
|
||||
// 处理 sticky 属性
|
||||
if (className == ".sticky") {
|
||||
if (
|
||||
decl.prop == "position" ||
|
||||
decl.value == "sticky"
|
||||
) {
|
||||
decl.remove();
|
||||
}
|
||||
}
|
||||
|
||||
// 解析声明值
|
||||
const parsed = valueParser(decl.value);
|
||||
let hasChanges = false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user