feat: First iteration, multi themes, I18N

This commit is contained in:
gauvainboiche
2026-10-08 11:58:18 +02:00
parent 9240fa3c3c
commit aa9721ac2a
53 changed files with 3363 additions and 1 deletions
+18
View File
@@ -0,0 +1,18 @@
// Applies a theme's stylesheet. Texts are handled by i18n.js, mechanics are
// shared (public/data); a theme is only a skin: colours, vocabulary, images.
export function applyThemeStyles(themeId) {
document.documentElement.dataset.theme = themeId;
let link = document.getElementById('theme-css');
if (!link) {
link = document.createElement('link');
link.id = 'theme-css';
link.rel = 'stylesheet';
document.head.append(link);
}
return new Promise((resolve) => {
link.onload = link.onerror = () => resolve();
link.href = `themes/${themeId}/theme.css`;
});
}