Skip to content
This repository was archived by the owner on Jun 2, 2024. It is now read-only.

Commit a36e8a3

Browse files
authored
fix: allow all accents to be used (#232)
1 parent 327d02c commit a36e8a3

7 files changed

+128
-31
lines changed

build.py

+2-26
Original file line numberDiff line numberDiff line change
@@ -231,38 +231,13 @@ def gnome_shell_version():
231231
f"@import 'extensions-{GS_VERSION}';",
232232
)
233233

234-
235-
# Accent translation
236-
ctp_to_colloid = {
237-
"rosewater": "pink",
238-
"flamingo": "pink",
239-
"pink": "pink",
240-
"mauve": "purple",
241-
"red": "red",
242-
"maroon": "red",
243-
"peach": "orange",
244-
"yellow": "yellow",
245-
"green": "green",
246-
"teal": "teal",
247-
"sky": "teal",
248-
"sapphire": "default",
249-
"blue": "default",
250-
"lavender": "default",
251-
}
252-
253-
254-
def translate_accent(ctp_accent: Color):
255-
return ctp_to_colloid[ctp_accent.identifier]
256-
257-
258234
def write_tweak(key, default, value):
259235
subst_text(
260236
f"{SRC_DIR}/sass/_tweaks-temp.scss", f"\\${key}: {default}", f"${key}: {value}"
261237
)
262238

263-
264239
def apply_tweaks(ctx: BuildContext):
265-
write_tweak("theme", "'default'", f"'{translate_accent(ctx.accent)}'")
240+
write_tweak("theme", "'default'", f"'{ctx.accent.identifier}'")
266241

267242
if ctx.size == "compact":
268243
write_tweak("compact", "'false'", "'true'")
@@ -476,6 +451,7 @@ def apply_colloid_patches():
476451
for patch in [
477452
"plank-dark.patch",
478453
"plank-light.patch",
454+
"theme-func.patch",
479455
"sass-palette-frappe.patch",
480456
"sass-palette-mocha.patch",
481457
"sass-palette-latte.patch",

patches/colloid/palette.tera

+16-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,22 @@ new file mode 100644
1111
index 00000000..4ff0da0d
1212
--- /dev/null
1313
+++ b/src/sass/_color-palette-catppuccin-{{ flavor.identifier }}.scss
14-
@@ -0,0 +1,72 @@
14+
@@ -0,0 +1,87 @@
15+
+ // Our accents
16+
+ $rosewater: #{{ palette.rosewater.hex }};
17+
+ $flamingo: #{{ palette.flamingo.hex }};
18+
+ $pink: #{{ palette.pink.hex }};
19+
+ $mauve: #{{ palette.mauve.hex }};
20+
+ $red: #{{ palette.red.hex }};
21+
+ $maroon: #{{ palette.maroon.hex }};
22+
+ $peach: #{{ palette.peach.hex }};
23+
+ $yellow: #{{ palette.yellow.hex }};
24+
+ $green: #{{ palette.green.hex }};
25+
+ $teal: #{{ palette.teal.hex }};
26+
+ $sky: #{{ palette.sky.hex }};
27+
+ $sapphire: #{{ palette.sapphire.hex }};
28+
+ $blue: #{{ palette.blue.hex }};
29+
+ $lavender: #{{ palette.lavender.hex }};
1530
+// Default Theme Color Palette
1631
+
1732
+// Red

patches/colloid/sass-palette-frappe.patch

+16-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,22 @@ new file mode 100644
33
index 00000000..4ff0da0d
44
--- /dev/null
55
+++ b/src/sass/_color-palette-catppuccin-frappe.scss
6-
@@ -0,0 +1,72 @@
6+
@@ -0,0 +1,87 @@
7+
+ // Our accents
8+
+ $rosewater: #f2d5cf;
9+
+ $flamingo: #eebebe;
10+
+ $pink: #f4b8e4;
11+
+ $mauve: #ca9ee6;
12+
+ $red: #e78284;
13+
+ $maroon: #ea999c;
14+
+ $peach: #ef9f76;
15+
+ $yellow: #e5c890;
16+
+ $green: #a6d189;
17+
+ $teal: #81c8be;
18+
+ $sky: #99d1db;
19+
+ $sapphire: #85c1dc;
20+
+ $blue: #8caaee;
21+
+ $lavender: #babbf1;
722
+// Default Theme Color Palette
823
+
924
+// Red

patches/colloid/sass-palette-latte.patch

+16-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,22 @@ new file mode 100644
33
index 00000000..4ff0da0d
44
--- /dev/null
55
+++ b/src/sass/_color-palette-catppuccin-latte.scss
6-
@@ -0,0 +1,72 @@
6+
@@ -0,0 +1,87 @@
7+
+ // Our accents
8+
+ $rosewater: #dc8a78;
9+
+ $flamingo: #dd7878;
10+
+ $pink: #ea76cb;
11+
+ $mauve: #8839ef;
12+
+ $red: #d20f39;
13+
+ $maroon: #e64553;
14+
+ $peach: #fe640b;
15+
+ $yellow: #df8e1d;
16+
+ $green: #40a02b;
17+
+ $teal: #179299;
18+
+ $sky: #04a5e5;
19+
+ $sapphire: #209fb5;
20+
+ $blue: #1e66f5;
21+
+ $lavender: #7287fd;
722
+// Default Theme Color Palette
823
+
924
+// Red

patches/colloid/sass-palette-macchiato.patch

+16-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,22 @@ new file mode 100644
33
index 00000000..4ff0da0d
44
--- /dev/null
55
+++ b/src/sass/_color-palette-catppuccin-macchiato.scss
6-
@@ -0,0 +1,72 @@
6+
@@ -0,0 +1,87 @@
7+
+ // Our accents
8+
+ $rosewater: #f4dbd6;
9+
+ $flamingo: #f0c6c6;
10+
+ $pink: #f5bde6;
11+
+ $mauve: #c6a0f6;
12+
+ $red: #ed8796;
13+
+ $maroon: #ee99a0;
14+
+ $peach: #f5a97f;
15+
+ $yellow: #eed49f;
16+
+ $green: #a6da95;
17+
+ $teal: #8bd5ca;
18+
+ $sky: #91d7e3;
19+
+ $sapphire: #7dc4e4;
20+
+ $blue: #8aadf4;
21+
+ $lavender: #b7bdf8;
722
+// Default Theme Color Palette
823
+
924
+// Red

patches/colloid/sass-palette-mocha.patch

+16-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,22 @@ new file mode 100644
33
index 00000000..4ff0da0d
44
--- /dev/null
55
+++ b/src/sass/_color-palette-catppuccin-mocha.scss
6-
@@ -0,0 +1,72 @@
6+
@@ -0,0 +1,87 @@
7+
+ // Our accents
8+
+ $rosewater: #f5e0dc;
9+
+ $flamingo: #f2cdcd;
10+
+ $pink: #f5c2e7;
11+
+ $mauve: #cba6f7;
12+
+ $red: #f38ba8;
13+
+ $maroon: #eba0ac;
14+
+ $peach: #fab387;
15+
+ $yellow: #f9e2af;
16+
+ $green: #a6e3a1;
17+
+ $teal: #94e2d5;
18+
+ $sky: #89dceb;
19+
+ $sapphire: #74c7ec;
20+
+ $blue: #89b4fa;
21+
+ $lavender: #b4befe;
722
+// Default Theme Color Palette
823
+
924
+// Red

patches/colloid/theme-func.patch

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
diff --git a/src/sass/_colors.scss b/src/sass/_colors.scss
2+
index 8738bf37..71797c6d 100644
3+
--- a/src/sass/_colors.scss
4+
+++ b/src/sass/_colors.scss
5+
@@ -58,27 +58,20 @@
6+
}
7+
8+
@function theme($color) {
9+
- @if ($variant == 'light') {
10+
- @if ($theme == 'default') { @return $default-dark; }
11+
- @if ($theme == 'purple') { @return $purple-dark; }
12+
- @if ($theme == 'pink') { @return $pink-dark; }
13+
- @if ($theme == 'red') { @return $red-dark; }
14+
- @if ($theme == 'orange') { @return $orange-dark; }
15+
- @if ($theme == 'yellow') { @return $yellow-dark; }
16+
- @if ($theme == 'green') { @return $green-dark; }
17+
- @if ($theme == 'teal') { @return $teal-dark; }
18+
- @if ($theme == 'grey') { @return $grey-600; }
19+
- } @else {
20+
- @if ($theme == 'default') { @return $default-light; }
21+
- @if ($theme == 'purple') { @return $purple-light; }
22+
- @if ($theme == 'pink') { @return $pink-light; }
23+
- @if ($theme == 'red') { @return $red-light; }
24+
- @if ($theme == 'orange') { @return $orange-light; }
25+
- @if ($theme == 'yellow') { @return $yellow-light; }
26+
- @if ($theme == 'green') { @return $green-light; }
27+
- @if ($theme == 'teal') { @return $teal-light; }
28+
- @if ($theme == 'grey') { @return $grey-200; }
29+
- }
30+
+ @if ($theme == 'rosewater') { @return $rosewater; }
31+
+ @if ($theme == 'flamingo') { @return $flamingo; }
32+
+ @if ($theme == 'pink') { @return $pink; }
33+
+ @if ($theme == 'mauve') { @return $mauve; }
34+
+ @if ($theme == 'red') { @return $red; }
35+
+ @if ($theme == 'maroon') { @return $maroon; }
36+
+ @if ($theme == 'peach') { @return $peach; }
37+
+ @if ($theme == 'yellow') { @return $yellow; }
38+
+ @if ($theme == 'green') { @return $green; }
39+
+ @if ($theme == 'teal') { @return $teal; }
40+
+ @if ($theme == 'sky') { @return $sky; }
41+
+ @if ($theme == 'sapphire') { @return $sapphire; }
42+
+ @if ($theme == 'blue') { @return $blue; }
43+
+ @if ($theme == 'lavender') { @return $lavender; }
44+
}
45+
46+
@function background($type) {

0 commit comments

Comments
 (0)