Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Use real theme style value replace var in preview mode https://github.com/siyuan-note/siyuan/issues/11458

Daniel35d1c106337e
diff --git a/kernel/model/theme.go b/kernel/model/theme.go
index b18982d7c4..dac7878f81 100644
--- a/kernel/model/theme.go
+++ b/kernel/model/theme.go
@@ -22,6 +22,7 @@ import (
"path/filepath"
"strings"
+ "github.com/88250/gulu"
"github.com/88250/lute/ast"
"github.com/88250/lute/parse"
"github.com/gorilla/css/scanner"
@@ -54,6 +55,10 @@ func fillThemeStyleVar(tree *parse.Tree) {
buf.WriteString(style)
buf.WriteString(": ")
value := themeStyles[name]
+ if strings.Contains(value, "-b3-") {
+ name = gulu.Str.SubStringBetween(value, "(", ")")
+ value = themeStyles[name]
+ }
if "" == value {
// 回退为变量
buf.WriteString("var(")