https://github.com/yisar/peacecss
Golang implement of postcss.
https://github.com/yisar/peacecss
Last synced: 6 months ago
JSON representation
Golang implement of postcss.
- Host: GitHub
- URL: https://github.com/yisar/peacecss
- Owner: yisar
- License: mit
- Created: 2022-02-25T15:38:40.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-08T04:49:07.000Z (almost 4 years ago)
- Last Synced: 2025-04-15T18:48:48.018Z (9 months ago)
- Language: Go
- Homepage: https://yisar.github.io/peacecss/
- Size: 3.83 MB
- Stars: 44
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# peacecss
Postcss alternative.
### [Playground](https://yisar.github.io/peacecss/)
### Use
```go
package main
import (
"fmt"
"github.com/yisar/peacecss"
)
func main() {
parser := peacecss.NewParser()
s := []byte(".a{color:#fff;}")
ast := parser.Parse(s)
ast.Traverse(func (node *peacecss.CSSDefinition){
fmt.Printf("%v", node)
node.Selector.Selector = ".b"
fmt.Printf("%v", node)
})
mini := ast.Minisize()
fmt.Printf("%s", mini.String())
}
```