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/styledeclaration.go
2024-12-14 22:30:21 +01:00

27 lines
519 B
Go

package css
import (
"fmt"
)
type CSSStyleDeclaration struct {
Property string
Value string
Important int
}
func NewCSSStyleDeclaration(property, value string, important int) *CSSStyleDeclaration {
return &CSSStyleDeclaration{
Property: property,
Value: value,
Important: important,
}
}
func (decl *CSSStyleDeclaration) Text() string {
if decl.Important == 1 {
return fmt.Sprintf("%s: %s !important", decl.Property, decl.Value)
}
return fmt.Sprintf("%s: %s", decl.Property, decl.Value)
}