Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vanng822/css

Basic css parser in golang
https://github.com/vanng822/css

css go parser

Last synced: about 8 hours ago
JSON representation

Basic css parser in golang

Awesome Lists containing this project

README

        

# css

Package css is for parsing css stylesheet.

# Document

[![GoDoc](https://godoc.org/github.com/vanng822/css?status.svg)](https://godoc.org/github.com/vanng822/css)

# 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)
}
}