summaryrefslogtreecommitdiff
path: root/vendor/github.com/aymerick/douceur/css/stylesheet.go
blob: 6b32c2ec90f41ced1fceb28992e03f930c968ad1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package css

// Stylesheet represents a parsed stylesheet
type Stylesheet struct {
	Rules []*Rule
}

// NewStylesheet instanciate a new Stylesheet
func NewStylesheet() *Stylesheet {
	return &Stylesheet{}
}

// Returns string representation of the Stylesheet
func (sheet *Stylesheet) String() string {
	result := ""

	for _, rule := range sheet.Rules {
		if result != "" {
			result += "\n"
		}
		result += rule.String()
	}

	return result
}