【文件属性】:
文件名称:css:Golang中的基本CSS解析器
文件大小:16KB
文件格式:ZIP
更新时间:2021-05-07 08:33:16
css go parser Go
CSS
软件包css用于解析css样式表。
文档
例子
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)
}
}
【文件预览】:
css-master
----.travis.yml(257B)
----at_parser_charset_test.go(662B)
----block_parser.go(4KB)
----selector_parser.go(1KB)
----parser.go(5KB)
----doc.go(372B)
----parser_test.go(4KB)
----LICENSE(1KB)
----at_parser.go(1KB)
----rule_test.go(398B)
----parser_media_test.go(4KB)
----value.go(2KB)
----parser_keyframes_test.go(2KB)
----stylerule.go(365B)
----stylerule_test.go(417B)
----.gitignore(18B)
----parser_selector_test.go(5KB)
----block_parser_test.go(1KB)
----styledeclaration_test.go(379B)
----skip_rule.go(504B)
----styledeclaration.go(505B)
----value_test.go(1KB)
----README.md(469B)
----stylesheet.go(188B)
----at_parser_import_test.go(1KB)
----rule.go(886B)