diff --git a/internal/system/box.go b/internal/system/box.go index 8e3230d..d34b46e 100644 --- a/internal/system/box.go +++ b/internal/system/box.go @@ -523,11 +523,17 @@ func (this *box) recursiveReApply () { // style hierarchyStyleNonce := this.getStyleNonce() if this.lastStyleNonce != hierarchyStyleNonce { + // remove old style this.lastStyleNonce = hierarchyStyleNonce if this.styleCookie != nil { this.styleCookie.Close() + this.styleCookie = nil + } + + // apply new one + if style := this.getStyle(); style != nil { + this.styleCookie = style.Apply(this.outer) } - this.styleCookie = this.getStyle().Apply(this.outer) this.on.styleChange.Broadcast() }