update tailwind v4, remove sass and postcss dependency
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -89,8 +89,6 @@ const setupTheme = () => {
|
||||
].forEach(toggleComment);
|
||||
|
||||
const includesFiles = [
|
||||
"tailwind.config.js",
|
||||
"postcss.config.js",
|
||||
"go.mod",
|
||||
"hugo.toml",
|
||||
"assets",
|
||||
|
||||
Reference in New Issue
Block a user