Skip to content

Commit ae03e92

Browse files
committed
feat: add catppuccin mocha theme
1 parent 3337446 commit ae03e92

File tree

2 files changed

+64
-13
lines changed

2 files changed

+64
-13
lines changed

src/configuration/RenderConfiguration.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,11 @@ async function RenderConfiguration() {
44

55
// Apply active theme
66
let ActiveTheme = './themes/'+(window.Configuration.Information.Theme || "Default")+'.css'
7-
fetch(ActiveTheme)
8-
.then(response => {
9-
if (!response.ok) {throw new Error(`Network response was not ok: ${response.status}`)}
10-
11-
let ComputedThemeConfig = getComputedStyle(document.querySelector("writea-theme-config"))
12-
var ThemeConfig = {
13-
"themeColor": ComputedThemeConfig.getPropertyValue('--theme-color')
14-
}
15-
16-
AppColor.content = ThemeConfig.themeColor || "#E87C86"
17-
18-
return AppTheme.innerHTML = `${response}`
19-
})
7+
AppTheme.innerHTML = `@import url('${ActiveTheme}')`
8+
let ComputedThemeConfig = getComputedStyle(document.querySelector("writea-theme-config"))
9+
var ThemeConfig = {
10+
"themeColor": ComputedThemeConfig.getPropertyValue('--theme-color')
11+
}
12+
AppColor.content = ThemeConfig.themeColor || "#E87C86"
2013
return;
2114
}

themes/CatppuccinMocha.css

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* Catppuccin Mocha writea theme
3+
*
4+
* Colors from https://catppuccin.com
5+
* Ported by https://github.com/prplwtf
6+
*/
7+
8+
writea-theme-config {
9+
--theme-color: #cba6f7;
10+
}
11+
12+
:root {
13+
color-scheme: dark;
14+
15+
--bs-body-color: #ced4da;
16+
--bs-body-color-rgb: 206,212,218;
17+
--bs-body-bg: #11111b;
18+
--bs-body-bg-rgb: 22,25,29;
19+
--bs-surface-color: #dee2e6;
20+
--bs-surface-color-rgb: 222,226,230;
21+
--bs-surface-bg: #212529;
22+
--bs-surface-bg-rgb: 33,37,41;
23+
--bs-surface-bg-hover: #25292d;
24+
25+
--bs-emphasis-color: #fff;
26+
--bs-emphasis-color-rgb: 255,255,255;
27+
--bs-muted-color: #868e96;
28+
--bs-heading-color: inherit;
29+
30+
--bs-primary: #cba6f7;
31+
--bs-primary-hover: #d3b7f5;
32+
--bs-primary-active: #dbc0fc;
33+
--bs-primary-subtle: #3d2857;
34+
--bs-primary-subtle-hover: #472f64;
35+
--bs-primary-subtle-active: #4d3569;
36+
--bs-primary-emphasis: #cba6f7;
37+
--bs-primary-emphasis-hover: #d3b7f5;
38+
--bs-primary-border-subtle: #472f64;
39+
--bs-primary-rgb: 203, 166, 247;
40+
--bs-text-on-primary: #000000;
41+
42+
--bs-dark: #45475a;
43+
--bs-dark-rgb: 111,113,116;
44+
--bs-dark-hover: #585b70;
45+
--bs-dark-active: #6c7086;
46+
--bs-dark-subtle: #1e1e2e;
47+
--bs-dark-subtle-hover: #313244;
48+
--bs-dark-subtle-active: #45475a;
49+
--bs-dark-emphasis: #9399b2;
50+
--bs-dark-emphasis-hover: #a6adc8;
51+
--bs-text-on-dark: #cdd6f4;
52+
--bs-dark-border-subtle: #585b70;
53+
54+
--bs-border-color: #6c7086;
55+
--bs-border-color-translucent: rgba(255, 255, 255, 0.15);
56+
--bs-border-radius: 1rem;
57+
--bs-border-width: 1px;
58+
}

0 commit comments

Comments
 (0)