fix: allow all accents to be used (#232)

This commit is contained in:
nullishamy
2024-05-24 21:19:52 +01:00
committed by GitHub
parent 327d02c0ec
commit a36e8a3b91
7 changed files with 128 additions and 31 deletions

View File

@@ -231,38 +231,13 @@ def gnome_shell_version():
f"@import 'extensions-{GS_VERSION}';",
)
# Accent translation
ctp_to_colloid = {
"rosewater": "pink",
"flamingo": "pink",
"pink": "pink",
"mauve": "purple",
"red": "red",
"maroon": "red",
"peach": "orange",
"yellow": "yellow",
"green": "green",
"teal": "teal",
"sky": "teal",
"sapphire": "default",
"blue": "default",
"lavender": "default",
}
def translate_accent(ctp_accent: Color):
return ctp_to_colloid[ctp_accent.identifier]
def write_tweak(key, default, value):
subst_text(
f"{SRC_DIR}/sass/_tweaks-temp.scss", f"\\${key}: {default}", f"${key}: {value}"
)
def apply_tweaks(ctx: BuildContext):
write_tweak("theme", "'default'", f"'{translate_accent(ctx.accent)}'")
write_tweak("theme", "'default'", f"'{ctx.accent.identifier}'")
if ctx.size == "compact":
write_tweak("compact", "'false'", "'true'")
@@ -476,6 +451,7 @@ def apply_colloid_patches():
for patch in [
"plank-dark.patch",
"plank-light.patch",
"theme-func.patch",
"sass-palette-frappe.patch",
"sass-palette-mocha.patch",
"sass-palette-latte.patch",