mirror of
https://github.com/crazy-max/diun.git
synced 2024-12-22 19:38:28 +00:00
.. | ||
.gitignore | ||
.travis.yml | ||
block_parser.go | ||
charset_parser.go | ||
doc.go | ||
import_parser.go | ||
LICENSE | ||
parser.go | ||
README.md | ||
rule.go | ||
selector_parser.go | ||
skip_rule.go | ||
styledeclaration.go | ||
stylerule.go | ||
stylesheet.go |
css
Package css is for parsing css stylesheet.
Document
example
import (
"github.com/vanng822/css"
"fmt"
)
func main() {
csstext := "td {width: 100px; height: 100px;}"
ss := css.Parse(csstext)
rules := ss.GetCSSRuleList()
for _, rule := range rules {
fmt.Println(rule.Style.SelectorText)
fmt.Println(rule.Style.Styles)
}
}