From 32f0f83ebf95a3d10615fed7056918d0e722c4ea Mon Sep 17 00:00:00 2001 From: Alexei Anoshenko Date: Thu, 21 Nov 2024 15:48:21 +0300 Subject: [PATCH] Bug fixing --- viewStyle.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/viewStyle.go b/viewStyle.go index 122a92f..50f1400 100644 --- a/viewStyle.go +++ b/viewStyle.go @@ -165,6 +165,12 @@ func (style *viewStyle) backgroundCSS(session Session) string { } if buffer.Len() > 0 { + backgroundColor, _ := colorProperty(style, BackgroundColor, session) + if backgroundColor != 0 { + buffer.WriteRune(' ') + buffer.WriteString(backgroundColor.cssString()) + } + return buffer.String() } } @@ -236,7 +242,7 @@ func (style *viewStyle) cssViewStyle(builder cssBuilder, session Session) { } colorProperties := []struct{ property, cssTag string }{ - {BackgroundColor, BackgroundColor}, + //{BackgroundColor, BackgroundColor}, {TextColor, "color"}, {TextLineColor, "text-decoration-color"}, {CaretColor, CaretColor}, @@ -254,6 +260,11 @@ func (style *viewStyle) cssViewStyle(builder cssBuilder, session Session) { if background := style.backgroundCSS(session); background != "" { builder.add("background", background) + } else { + backgroundColor, _ := colorProperty(style, BackgroundColor, session) + if backgroundColor != 0 { + builder.add("background-color", backgroundColor.cssString()) + } } if font, ok := stringProperty(style, FontName, session); ok && font != "" {