theme api

This commit is contained in:
Sebastian Herrlinger
2026-03-06 22:45:17 +01:00
parent 3f9603e7a6
commit 29aab3223c
8 changed files with 307 additions and 71 deletions

View File

@@ -1,5 +1,4 @@
/** @jsxImportSource @opentui/solid */
import mytheme from "../themes/mytheme.json" with { type: "json" }
import { extend, useKeyboard, useTerminalDimensions, type RenderableConstructor } from "@opentui/solid"
import { RGBA, VignetteEffect, type OptimizedBuffer, type RenderContext } from "@opentui/core"
import { ThreeRenderable, THREE } from "@opentui/core/3d"
@@ -726,13 +725,12 @@ const reg = (api: TuiApi, input: ReturnType<typeof cfg>) => {
])
}
const themes = {
"workspace-plugin-smoke": mytheme,
}
const tui = async (input: TuiPluginInput, options?: Record<string, unknown>) => {
if (options?.enabled === false) return
await input.api.theme.install("../themes/mytheme.json")
input.api.theme.set("mytheme")
const value = cfg(options)
const route = names(value)
const fx = new VignetteEffect(value.vignette)
@@ -770,6 +768,5 @@ const tui = async (input: TuiPluginInput, options?: Record<string, unknown>) =>
}
export default {
themes,
tui,
}