🎨 Use real theme style value replace var in preview mode https://github.com/siyuan-note/siyuan/issues/11458
This commit is contained in:
parent
317e84dd7b
commit
35d1c10633
1 changed files with 5 additions and 0 deletions
|
@ -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(")
|
||||
|
|
Loading…
Add table
Reference in a new issue