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