go-libsass
Go wrapper to the 100% Sass compatible libsass project
About go-libsass
libsass
- Deprecated Try this project https://github.com/bep/godartsass
The only Sass compliant Go library! go-libsass is a wrapper to the sass/libsass project.
To build, setup Go
go build
To test
go test
Basic example more examples found in examples
buf := bytes.NewBufferString("div { p { color: red; } }")
if err != nil {
log.Fatal(err)
}
comp, err := libsass.New(os.Stdout, buf)
if err != nil {
log.Fatal(err)
}
if err := comp.Run(); err != nil {
log.Fatal(err)
}
Output
div p {
color: red; }
Updating libsass
cd libsass-src; git fetch; git checkout vX.X.X
git commit -m "updated libsass to vX.X.X"
make update-libsass
# iterate on includes and code changes until tests pass
FAQ
-
Compiling go-libsass is very slow, what can be done?
Go-libsass compiles C/C++ libsass on every build. You can install the package and speed up building
go install github.com/wellington/go-libsass. Alternatively, it's possible to link against system libsass and forego C compiling withgo build -tags dev. -
How do I cross compile?
Since this package uses C bindings, you will need gcc for the target platform. For windows see, https://github.com/wellington/go-libsass/issues/37
Frequently Asked Questions
What is go-libsass?
go-libsass is a CSS Preprocessors library for the Go programming language. Go wrapper to the 100% Sass compatible libsass project
How do I install go-libsass?
Install go-libsass with the Go module system using `go get wellington/go-libsass`. Check the repository for the current installation instructions.
What category does go-libsass belong to?
go-libsass is listed under CSS Preprocessors, specifically CSS Preprocessors.