https://github.com/wellington/go-libsass
Go wrapper for libsass, the only Sass 3.5 compiler for Go
https://github.com/wellington/go-libsass
Last synced: about 1 month ago
JSON representation
Go wrapper for libsass, the only Sass 3.5 compiler for Go
- Host: GitHub
- URL: https://github.com/wellington/go-libsass
- Owner: wellington
- License: apache-2.0
- Created: 2015-04-19T15:09:47.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2023-12-05T09:50:44.000Z (almost 2 years ago)
- Last Synced: 2024-10-25T04:09:49.325Z (about 1 year ago)
- Language: C++
- Homepage: http://godoc.org/github.com/wellington/go-libsass
- Size: 4.15 MB
- Stars: 206
- Watchers: 9
- Forks: 29
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go-cn - go-libsass
- awesome-go-plus - go-libsass - Go wrapper to the 100% Sass compatible libsass project.  (CSS Preprocessors / Standard CLI)
- fucking-awesome-go - :octocat: go-libsass - Go wrapper to the 100% Sass compatible libsass project. :star: 28 :fork_and_knife: 3 (CSS Preprocessors / Advanced Console UIs)
- awesome-go - go-libsass - Go wrapper to the 100% Sass compatible libsass project. (CSS Preprocessors / Standard CLI)
- fucking-awesome-go - go-libsass - Go wrapper to the 100% Sass compatible libsass project. (CSS Preprocessors / Standard CLI)
- awesome-go - go-libsass - | - | - | (CSS Preprocessors / Advanced Console UIs)
- awesome-go - go-libsass - Go wrapper to the 100% Sass compatible libsass project. (CSS Preprocessors / Standard CLI)
- awesome-go - go-libsass - Go wrapper to the 100% Sass compatible libsass project. (CSS Preprocessors / Standard CLI)
- awesome-go - go-libsass - Go wrapper to the 100% Sass compatible libsass project. - :arrow_down:34 - :star:36 (CSS Preprocessors / Advanced Console UIs)
- awesome-go - go-libsass - Go wrapper to the 100% Sass compatible libsass project. (CSS Preprocessors / Advanced Console UIs)
- awesome-github-star - go-libsass
- awesome-go-extra - go-libsass - 04-19T15:09:47Z|2020-10-23T19:07:14Z| (CSS Preprocessors / Advanced Console UIs)
- awesome-go - go-libsass - 打包到100%Sass兼容的libsass项目。 (<span id="css预处理器-css-preprocessors">CSS预处理器 CSS Preprocessors</span> / <span id="高级控制台用户界面-advanced-console-uis">高级控制台用户界面 Advanced Console UIs</span>)
- awesome-go - go-libsass - Go wrapper for libsass, the only Sass 3.5 compiler for Go - ★ 107 (CSS Preprocessors)
- awesome-go - go-libsass - Go wrapper to the 100% Sass compatible libsass project. (CSS Preprocessors / Standard CLI)
- awesome-go - go-libsass - Go wrapper to the 100% Sass compatible libsass project. (CSS Preprocessors / Standard CLI)
- awesome-go-with-stars - go-libsass - Go wrapper to the 100% Sass compatible libsass project. (CSS Preprocessors / Standard CLI)
- awesome-go-cn - go-libsass
- awesome-go - go-libsass - Go wrapper to the 100% Sass compatible libsass project. (CSS Preprocessors / Advanced Console UIs)
- awesome-Char - go-libsass - Go wrapper to the 100% Sass compatible libsass project. (CSS Preprocessors / Advanced Console UIs)
- awesome-go-cn - go-libsass
- awesome-go - wellington/go-libsass
- awesome-go-cn - go-libsass
README
libsass
=========
* Deprecated
Try this project [https://github.com/bep/godartsass](https://github.com/bep/godartsass)
[](https://circleci.com/gh/wellington/go-libsass) [](https://ci.appveyor.com/project/drewwells/go-libsass/branch/master)
The only Sass compliant Go library! go-libsass is a wrapper to the [sass/libsass](http://github.com/sass/libsass) project.
To build, setup Go
go build
To test
go test
Basic example more examples found in [examples](examples)
```go
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 with `go 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