update tailwind v4, remove sass and postcss dependency

This commit is contained in:
Somrat
2025-02-16 12:07:19 +06:00
parent 3b220f635d
commit 02085ffbe0
29 changed files with 468 additions and 416 deletions

View File

@@ -3,10 +3,6 @@ const path = require("path");
const rootDirs = ["assets/scss", "layouts"];
const configFiles = [
{
filePath: "exampleSite/tailwind.config.js",
patterns: ["darkmode:\\s*{[^}]*},", 'darkMode:\\s*"class",'],
},
{
filePath: "exampleSite/data/theme.json",
patterns: ["colors.darkmode"],
@@ -75,13 +71,9 @@ function removeDarkModeFromPages(directoryPath) {
function removeDarkMode(configFile) {
const { filePath, patterns } = configFile;
if (filePath === "exampleSite/tailwind.config.js") {
removeDarkModeFromFiles(filePath, patterns);
} else {
const contentFile = JSON.parse(fs.readFileSync(filePath, "utf8"));
patterns.forEach((pattern) => deleteNestedProperty(contentFile, pattern));
fs.writeFileSync(filePath, JSON.stringify(contentFile));
}
const contentFile = JSON.parse(fs.readFileSync(filePath, "utf8"));
patterns.forEach((pattern) => deleteNestedProperty(contentFile, pattern));
fs.writeFileSync(filePath, JSON.stringify(contentFile));
}
function deleteNestedProperty(obj, propertyPath) {

View File

@@ -89,8 +89,6 @@ const setupTheme = () => {
].forEach(toggleComment);
const includesFiles = [
"tailwind.config.js",
"postcss.config.js",
"go.mod",
"hugo.toml",
"assets",