aboutsummaryrefslogtreecommitdiff
path: root/internal/server/templates
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-01-19 23:05:26 -0800
committerFuwn <[email protected]>2026-01-19 23:05:26 -0800
commit4cbee4da97dcc2832cd354142aa9909a80070952 (patch)
tree338f54b0ee2dd033f5049888b586aa3c77e22c18 /internal/server/templates
parentfix: Remove duplicate monitor name validation across groups (diff)
downloadkaze-4cbee4da97dcc2832cd354142aa9909a80070952.tar.xz
kaze-4cbee4da97dcc2832cd354142aa9909a80070952.zip
feat: Add OpenCode-compatible theme loader
Add support for loading and applying OpenCode-compatible themes via URL. Fetches theme JSON, resolves color references, generates CSS variables and Tailwind class overrides to apply the theme seamlessly. Features: - Add theme_url config field under site section - Fetch and parse OpenCode theme.json format - Generate CSS custom properties (--theme-*) for all theme colors - Generate Tailwind class overrides to apply theme colors - Support both light and dark modes - Template.CSS type for safe CSS injection Example usage: site: theme_url: "https://raw.githubusercontent.com/anomalyco/opencode/.../opencode.json" Theme schema: https://opencode.ai/theme.json
Diffstat (limited to 'internal/server/templates')
-rw-r--r--internal/server/templates/index.html6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/server/templates/index.html b/internal/server/templates/index.html
index db4c61a..6bdfeff 100644
--- a/internal/server/templates/index.html
+++ b/internal/server/templates/index.html
@@ -11,6 +11,12 @@
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🎐</text></svg>">
{{end}}
<link rel="stylesheet" href="/static/style.css">
+ {{if .ThemeCSS}}
+ <style>
+ /* OpenCode Theme */
+{{.ThemeCSS}}
+ </style>
+ {{end}}
<script>
// Theme detection
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {