vanng822 / css

Basic css parser in golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

css

Package css is for parsing css stylesheet.

Document

GoDoc

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.Selector.Text())
		fmt.Println(rule.Style.Styles)
	}
}

About

Basic css parser in golang

License:MIT License


Languages

Language:Go 100.0%