Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
ccd0439
the big rename
fehmer Jan 14, 2026
c043210
wip
fehmer Jan 14, 2026
d6fed71
wip
fehmer Jan 15, 2026
7dc15bb
wip
fehmer Jan 15, 2026
720c58a
fix
fehmer Jan 15, 2026
cb70a08
the big yeet
fehmer Jan 15, 2026
b3efd3d
add loader and error handling to css loading
fehmer Jan 15, 2026
c4bd55f
fix color picker, remove colorVars
fehmer Jan 15, 2026
1fa02f4
fallback variables
fehmer Jan 15, 2026
5785174
update themes documentation
fehmer Jan 15, 2026
97cf5e9
update pr template
fehmer Jan 15, 2026
aea03e6
review comments
fehmer Jan 15, 2026
60b2080
fix colorpicker buttons
fehmer Jan 15, 2026
10b68e9
speed up converter
Miodec Jan 15, 2026
a03bb63
fix theme color reset, optimise convertToHex
fehmer Jan 15, 2026
f1b7583
convert without dom
fehmer Jan 15, 2026
39e39d9
cleanup colors
fehmer Jan 15, 2026
8765391
convert three digits hex
fehmer Jan 15, 2026
b493d5e
fix styles rendered into body
fehmer Jan 16, 2026
f411e68
convert more head meta, update all chart colors with signals
fehmer Jan 16, 2026
4d61ceb
naming, better update
fehmer Jan 16, 2026
45d32da
cleanup
fehmer Jan 16, 2026
9a1c99d
remove log. cleanup debug logs, fix onLoad called multiple times. fix…
fehmer Jan 16, 2026
d6a7d65
remove empty css files, make sure animations are unique, remove unuse…
fehmer Jan 16, 2026
c3cbd7e
impove theme asset check
fehmer Jan 16, 2026
95c0b05
better type for theme name, store theme name in theme signal
fehmer Jan 16, 2026
567df81
clarify text in themeIndicator is not the theme name
fehmer Jan 16, 2026
2c5e6f6
test/fix error handling on missing css
fehmer Jan 16, 2026
cd964f2
fix for #7142
fehmer Jan 16, 2026
e5c94bc
Theme.tsx tests
fehmer Jan 16, 2026
ed00b17
Merge branch 'master' into feature/remove-theme-color-duplicates
fehmer Jan 18, 2026
21b4137
use new background loader
fehmer Jan 18, 2026
210b7f5
Merge branch 'master' into feature/remove-theme-color-duplicates
fehmer Jan 18, 2026
58781cd
fix tests
fehmer Jan 18, 2026
b3e9ae5
Merge branch 'master' into feature/remove-theme-color-duplicates
fehmer Jan 19, 2026
0736573
format?
fehmer Jan 19, 2026
35ba071
edit button placement
Miodec Jan 19, 2026
cf974ca
add util, use it
Miodec Jan 19, 2026
39a2e61
debounced util
Miodec Jan 19, 2026
ec8641e
review comments
fehmer Jan 19, 2026
a22f796
fixes, debounce effects
fehmer Jan 19, 2026
0d3391e
fix placement
Miodec Jan 19, 2026
96c3347
add debounce options
Miodec Jan 19, 2026
852e914
indent
Miodec Jan 19, 2026
19aff9e
move components which arent really part of the layout
Miodec Jan 19, 2026
045a77b
strings
Miodec Jan 19, 2026
adc2503
at begin
Miodec Jan 19, 2026
26f810b
throw if color is invalid
Miodec Jan 19, 2026
f0fdb87
remove todo
fehmer Jan 19, 2026
e6a24bf
remove duplicate Theme.tsx, fix metaThemeColor
fehmer Jan 19, 2026
9eb814f
move text with component, fix
fehmer Jan 19, 2026
5066b45
remove at begin
Miodec Jan 20, 2026
9a85d0f
debounce delays
Miodec Jan 20, 2026
6aca394
review comments
fehmer Jan 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions frontend/scripts/check-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Layout, ThemeName } from "@monkeytype/schemas/configs";
import { LayoutsList } from "../src/ts/constants/layouts";
import { KnownFontName } from "@monkeytype/schemas/fonts";
import { Fonts } from "../src/ts/constants/fonts";
import { ThemesList } from "../src/ts/constants/themes";
import { themes, ThemeSchema, ThemesList } from "../src/ts/constants/themes";
import { z } from "zod";
import { ChallengeSchema, Challenge } from "@monkeytype/schemas/challenges";
import { LayoutObject, LayoutObjectSchema } from "@monkeytype/schemas/layouts";
Expand Down Expand Up @@ -381,20 +381,27 @@ async function validateThemes(): Promise<void> {
//no missing files
const themeFiles = fs.readdirSync("./static/themes");

//missing theme files
ThemesList.filter((it) => !themeFiles.includes(it.name + ".css")).forEach(
(it) =>
problems.add(
it.name,
`missing file frontend/static/themes/${it.name}.css`,
),
//missing or additional theme files (mismatch in hasCss)
ThemesList.filter(
(it) => themeFiles.includes(it.name + ".css") !== (it.hasCss ?? false),
).forEach((it) =>
problems.add(
it.name,
`${it.hasCss ? "missing" : "additional"} file frontend/static/themes/${it.name}.css`,
),
);

//additional theme files
themeFiles
.filter((it) => !ThemesList.some((theme) => theme.name + ".css" === it))
.forEach((it) => problems.add("_additional", it));

//validate theme colors are valid hex colors, not covered by typescipt
for (const name of Object.keys(themes)) {
const theme = themes[name as ThemeName];
problems.addValidation(name as ThemeName, ThemeSchema.safeParse(theme));
}

console.log(problems.toString());

if (problems.hasError()) {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/html/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Monkeytype | A minimalistic, customizable typing test</title>
<!-- default colors in case theme file fails to load -->
<style>
<style id="themeFallback">
:root {
--bg-color: #323437;
--main-color: #e2b714;
Expand All @@ -41,6 +40,7 @@
--colorful-error-extra-color: #7e2a33;
}
</style>
<Theme />
<link
rel="icon"
type="image/x-icon"
Expand Down
129 changes: 41 additions & 88 deletions frontend/src/html/pages/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -1535,15 +1535,10 @@
<div class="customThemeInputs">
<div class="customThemeInput">
<label class="colorText">background</label>
<div class="colorPicker inputAndButton">
<input
type="text"
value="#000000"
class="input"
id="--bg-color-txt"
/>
<div class="colorPicker inputAndButton" data-key="bg">
<input type="text" value="#000000" class="input" />
<label
for="--bg-color"
for="colorPickerBg"
class="button"
style="
color: var(--text-color);
Expand All @@ -1556,21 +1551,16 @@
type="color"
class="color"
value="#000000"
id="--bg-color"
id="colorPickerBg"
/>
</div>
</div>
<div class="customThemeInput">
<label class="colorText">sub alt</label>
<div class="colorPicker inputAndButton">
<input
type="text"
value="#000000"
class="input"
id="--sub-alt-color-txt"
/>
<div class="colorPicker inputAndButton" data-key="subAlt">
<input type="text" value="#000000" class="input" />
<label
for="--sub-alt-color"
for="colorPickerSubAlt"
class="button"
style="
color: var(--text-color);
Expand All @@ -1583,39 +1573,29 @@
type="color"
class="color"
value="#000000"
id="--sub-alt-color"
id="colorPickerSubAlt"
/>
</div>
</div>
<div class="customThemeInput">
<label class="colorText">main</label>
<div class="colorPicker inputAndButton">
<input
type="text"
value="#000000"
class="input"
id="--main-color-txt"
/>
<label for="--main-color" class="button">
<div class="colorPicker inputAndButton" data-key="main">
<input type="text" value="#000000" class="input" />
<label for="colorPickerMain" class="button">
<i class="fas fa-fw fa-palette"></i>
</label>
<input
type="color"
class="color"
value="#000000"
id="--main-color"
id="colorPickerMain"
/>
</div>
</div>
<div class="customThemeInput">
<label class="colorText">sub</label>
<div class="colorPicker inputAndButton">
<input
type="text"
value="#000000"
class="input"
id="--sub-color-txt"
/>
<div class="colorPicker inputAndButton" data-key="sub">
<input type="text" value="#000000" class="input" />
<label for="--sub-color" class="button">
<i class="fas fa-fw fa-palette"></i>
</label>
Expand All @@ -1629,41 +1609,31 @@
</div>
<div class="customThemeInput">
<label class="colorText">caret</label>
<div class="colorPicker inputAndButton">
<input
type="text"
value="#000000"
class="input"
id="--caret-color-txt"
/>
<label for="--caret-color" class="button">
<div class="colorPicker inputAndButton" data-key="caret">
<input type="text" value="#000000" class="input" />
<label for="colorPickerCaret" class="button">
<i class="fas fa-fw fa-palette"></i>
</label>
<input
type="color"
class="color"
value="#000000"
id="--caret-color"
id="colorPickerCaret"
/>
</div>
</div>
<div class="customThemeInput">
<label class="colorText">text</label>
<div class="colorPicker inputAndButton">
<input
type="text"
value="#000000"
class="input"
id="--text-color-txt"
/>
<label for="--text-color" class="button">
<div class="colorPicker inputAndButton" data-key="text">
<input type="text" value="#000000" class="input" />
<label for="colorPickerText" class="button">
<i class="fas fa-fw fa-palette"></i>
</label>
<input
type="color"
class="color"
value="#000000"
id="--text-color"
id="colorPickerText"
/>
</div>
</div>
Expand All @@ -1672,83 +1642,66 @@

<div class="customThemeInput">
<label class="colorText">error</label>
<div class="colorPicker inputAndButton">
<input
type="text"
value="#000000"
class="input"
id="--error-color-txt"
/>
<label for="--error-color" class="button">
<div class="colorPicker inputAndButton" data-key="error">
<input type="text" value="#000000" class="input" />
<label for="colorPickerError" class="button">
<i class="fas fa-fw fa-palette"></i>
</label>
<input
type="color"
class="color"
value="#000000"
id="--error-color"
id="colorPickerError"
/>
</div>
</div>
<div class="customThemeInput">
<label class="colorText">extra error</label>
<div class="colorPicker inputAndButton">
<input
type="text"
value="#000000"
class="input"
id="--error-extra-color-txt"
/>
<label for="--error-extra-color" class="button">
<div class="colorPicker inputAndButton" data-key="errorExtra">
<input type="text" value="#000000" class="input" />
<label for="colorPickerExtraError" class="button">
<i class="fas fa-fw fa-palette"></i>
</label>
<input
type="color"
class="color"
value="#000000"
id="--error-extra-color"
id="colorPickerExtraError"
/>
</div>
</div>

<span class="colorfulHeader">colorful mode</span>
<div class="customThemeInput">
<label class="colorText">error</label>
<div class="colorPicker inputAndButton">
<input
type="text"
value="#000000"
class="input"
id="--colorful-error-color-txt"
/>
<label for="--colorful-error-color" class="button">
<div class="colorPicker inputAndButton" data-key="colorfulError">
<input type="text" value="#000000" class="input" />
<label for="colorPickerColorfulError" class="button">
<i class="fas fa-fw fa-palette"></i>
</label>
<input
type="color"
class="color"
value="#000000"
id="--colorful-error-color"
id="colorPickerColorfulError"
/>
</div>
</div>
<div class="customThemeInput">
<label class="colorText">extra error</label>
<div class="colorPicker inputAndButton">
<input
type="text"
value="#000000"
class="input"
id="--colorful-error-extra-color-txt"
/>
<label for="--colorful-error-extra-color" class="button">
<div
class="colorPicker inputAndButton"
data-key="colorfulErrorExtra"
>
<input type="text" value="#000000" class="input" />
<label for="colorPickerColorfulErrorExtra" class="button">
<i class="fas fa-fw fa-palette"></i>
</label>
<input
type="color"
class="color"
value="#000000"
id="--colorful-error-extra-color"
id="colorPickerColorfulErrorExtra"
/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
async
defer
></script>
<link rel="stylesheet" href="/themes/serika_dark.css" id="currentTheme" />

<link rel="stylesheet" href="" id="globalFunBoxTheme" type="text/css" />
<script type="module" src="ts/index.ts"></script>
</body>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/ts/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ export async function onAuthStateChanged(

if (authInitialisedAndConnected) {
console.debug(`auth state changed, user ${user ? "true" : "false"}`);
console.debug(user);
if (user) {
userPromise = loadUser(user);
} else {
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/ts/commandline/commandline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,16 +531,16 @@ async function showCommands(): Promise<void> {
<i class="fas fa-star"></i>
</div>
<div class="themeBubbles" style="background: ${
command.customData["bgColor"]
};outline: 0.25rem solid ${command.customData["bgColor"]};">
command.customData["bg"]
};outline: 0.25rem solid ${command.customData["bg"]};">
<div class="themeBubble" style="background: ${
command.customData["mainColor"]
command.customData["main"]
}"></div>
<div class="themeBubble" style="background: ${
command.customData["subColor"]
command.customData["sub"]
}"></div>
<div class="themeBubble" style="background: ${
command.customData["textColor"]
command.customData["text"]
}"></div>
</div>
</div>`;
Expand Down
Loading
Loading