stylesheet.go (441B)
1 package css 2 3 // Stylesheet represents a parsed stylesheet 4 type Stylesheet struct { 5 Rules []*Rule 6 } 7 8 // NewStylesheet instanciate a new Stylesheet 9 func NewStylesheet() *Stylesheet { 10 return &Stylesheet{} 11 } 12 13 // Returns string representation of the Stylesheet 14 func (sheet *Stylesheet) String() string { 15 result := "" 16 17 for _, rule := range sheet.Rules { 18 if result != "" { 19 result += "\n" 20 } 21 result += rule.String() 22 } 23 24 return result 25 }