stylesheet.go

 1package css
 2
 3// Stylesheet represents a parsed stylesheet
 4type Stylesheet struct {
 5	Rules []*Rule
 6}
 7
 8// NewStylesheet instanciate a new Stylesheet
 9func NewStylesheet() *Stylesheet {
10	return &Stylesheet{}
11}
12
13// Returns string representation of the Stylesheet
14func (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}