chore(tree-wide): change default accent color to mauve (#848)

This commit is contained in:
uncenter authored and GitHub committed 2024-04-28 07:12:21 -04:00
1 parent 014a95ae7b
commit 2c3dcf47ab
86 files changed
+96 -87

No files matched your search

+5 -2
View File
@@ -29,16 +29,19 @@ for await (const entry of stylesheets) {
const dir = basename(dirname(entry.path));
const file = relative(REPO_ROOT, entry.path);
const content = await Deno.readTextFile(entry.path);
let content = await Deno.readTextFile(entry.path);
// Verify the UserCSS metadata.
const { globalVars, isLess } = await verifyMetadata(
const { globalVars, isLess, fixed } = await verifyMetadata(
entry,
content,
dir,
userstyles,
flags.fix,
);
content = fixed;
// Don't attempt to compile or lint non-LESS files.
if (!isLess) continue;
+7 -1
View File
@@ -15,6 +15,7 @@ export const verifyMetadata = async (
content: string,
userstyle: string,
userstyles: Userstyles,
fix: boolean,
) => {
// `usercss-meta` prohibits any '\r' characters, which seem to be present on Windows.
content = content.replaceAll("\r\n", "\n");
@@ -69,7 +70,7 @@ export const verifyMetadata = async (
for (const variable of ["darkFlavor", "lightFlavor", "accentColor"]) {
const declaration = `@var select ${variable}`;
const expected = template.find((line) => line.includes(declaration));
const expected = template.find((line) => line.includes(declaration))!;
const current = lines.findIndex((line) => line.includes(declaration)) +
1;
@@ -103,6 +104,10 @@ export const verifyMetadata = async (
startLine: current,
content,
}, "warning");
if (fix) {
content = content.replace(lines[current - 1], expected);
}
}
}
@@ -118,6 +123,7 @@ export const verifyMetadata = async (
return {
globalVars,
isLess: metadata.preprocessor === assert.preprocessor,
fixed: content,
};
};