mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-06 00:12:11 +00:00
feat(desktop): themes
This commit is contained in:
parent
d6db6ff198
commit
4a9ff9412e
31 changed files with 3573 additions and 1099 deletions
18
packages/app/script/inject-theme-preload.ts
Normal file
18
packages/app/script/inject-theme-preload.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/**
|
||||
* Injects the theme preload script into index.html.
|
||||
* Run this as part of the build process.
|
||||
*/
|
||||
|
||||
import { generatePreloadScript } from "@opencode-ai/ui/theme"
|
||||
|
||||
const htmlPath = new URL("../index.html", import.meta.url).pathname
|
||||
const html = await Bun.file(htmlPath).text()
|
||||
|
||||
const script = generatePreloadScript()
|
||||
const injectedHtml = html.replace(
|
||||
/<script id="oc-theme-preload-script">\s*\/\* THEME_PRELOAD_SCRIPT \*\/\s*<\/script>/,
|
||||
`<script id="oc-theme-preload-script">${script}</script>`,
|
||||
)
|
||||
|
||||
await Bun.write(htmlPath, injectedHtml)
|
||||
console.log("Injected theme preload script into index.html")
|
||||
Loading…
Add table
Add a link
Reference in a new issue