0
0
mirror of https://github.com/crazy-max/diun.git synced 2024-12-22 19:38:28 +00:00
crazy-max_diun/vendor/github.com/vanng822/css/stylerule.go
2024-12-14 22:30:21 +01:00

22 lines
367 B
Go

package css
import (
"fmt"
"strings"
)
type CSSStyleRule struct {
SelectorText string
Styles []*CSSStyleDeclaration
}
func (sr *CSSStyleRule) Text() string {
decls := make([]string, 0, len(sr.Styles))
for _, s := range sr.Styles {
decls = append(decls, s.Text())
}
return fmt.Sprintf("%s {\n%s\n}", sr.SelectorText, strings.Join(decls, ";\n"))
}