update plugin themes when plugin was updated (#20052)
This commit is contained in:
parent
3c32013eb1
commit
8e4bab5181
6 changed files with 237 additions and 38 deletions
|
|
@ -183,6 +183,18 @@ export function addTheme(name: string, theme: unknown) {
|
|||
return true
|
||||
}
|
||||
|
||||
export function upsertTheme(name: string, theme: unknown) {
|
||||
if (!name) return false
|
||||
if (!isTheme(theme)) return false
|
||||
if (customThemes[name] !== undefined) {
|
||||
customThemes[name] = theme
|
||||
} else {
|
||||
pluginThemes[name] = theme
|
||||
}
|
||||
syncThemes()
|
||||
return true
|
||||
}
|
||||
|
||||
export function resolveTheme(theme: ThemeJson, mode: "dark" | "light") {
|
||||
const defs = theme.defs ?? {}
|
||||
function resolveColor(c: ColorValue, chain: string[] = []): RGBA {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue