feat: 添加 Tailwind CSS 支持,更新样式文件并移除不必要的文件
All checks were successful
/ test (push) Successful in 27s

This commit is contained in:
严浩
2024-11-22 17:59:32 +08:00
parent 7fdbea82d6
commit 0b40d065ca
9 changed files with 11 additions and 144 deletions

View File

@ -4,55 +4,8 @@ import {
presetUno,
transformerVariantGroup
} from "unocss";
import { fkLibrary } from "./formkit.config.fkLibrary";
import { classes, globals } from "./formkit.config.theme";
const familyList = [
...new Set(Object.values(fkLibrary).map((lib) => lib.family)),
].filter((f) => f) as string[];
const typeList = [
...new Set(Object.values(fkLibrary).map((lib) => lib.type)),
].filter((f) => f) as string[];
console.debug(`familyList :>> `, familyList);
console.debug(`typeList :>> `, typeList);
const globalsR = [
...new Set(Object.values(globals).flatMap((v) => Object.keys(v))),
];
const classesR = [
...new Set(
Object.keys(classes)
.filter(
(k) =>
familyList.some((f) => k.includes(f)) ||
typeList.some((t) => k.includes(t))
)
.map((k) => classes[k])
.flatMap((v) => Object.keys(v))
.filter((className) => !className.includes("[]"))
.filter((className) => !className.includes("&::"))
),
];
// console.debug(`classesR :>> `, classesR);
export default defineConfig({
content: {
filesystem: ["xx.ts"],
inline: [
"!border-none", // for: "range__inner"
classesR.join(" "),
globalsR.join(" "),
async () => {
return "";
},
],
pipeline: {
// include: [
// /xx.ts($|\?)/,
// ],
},
},
presets: [
presetUno({
dark: "media",