vendor dependencies with dep
This commit is contained in:
parent
93d8310491
commit
1384296a47
2712 changed files with 965742 additions and 0 deletions
43
vendor/github.com/vanng822/css/rule.go
generated
vendored
Normal file
43
vendor/github.com/vanng822/css/rule.go
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
package css
|
||||
|
||||
import ()
|
||||
|
||||
type RuleType int
|
||||
|
||||
const (
|
||||
STYLE_RULE RuleType = iota
|
||||
CHARSET_RULE
|
||||
IMPORT_RULE
|
||||
MEDIA_RULE
|
||||
FONT_FACE_RULE
|
||||
PAGE_RULE
|
||||
|
||||
)
|
||||
|
||||
var ruleTypeNames = map[RuleType]string{
|
||||
STYLE_RULE: "",
|
||||
MEDIA_RULE: "@media",
|
||||
CHARSET_RULE: "@charset",
|
||||
IMPORT_RULE: "@import",
|
||||
FONT_FACE_RULE: "@font-face",
|
||||
PAGE_RULE: "@page",
|
||||
}
|
||||
|
||||
func (rt RuleType) Text() string {
|
||||
return ruleTypeNames[rt]
|
||||
}
|
||||
|
||||
type CSSRule struct {
|
||||
Type RuleType
|
||||
Style CSSStyleRule
|
||||
Rules []*CSSRule
|
||||
}
|
||||
|
||||
func NewRule(ruleType RuleType) *CSSRule {
|
||||
r := &CSSRule{
|
||||
Type: ruleType,
|
||||
}
|
||||
r.Style.Styles = make(map[string]*CSSStyleDeclaration)
|
||||
r.Rules = make([]*CSSRule, 0)
|
||||
return r
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue