File: README.md

package info (click to toggle)
golang-github-wellington-go-libsass 0.9.2%2Bgit20181130.4ef5b9d-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,128 kB
  • sloc: cpp: 28,607; ansic: 839; makefile: 44
file content (56 lines) | stat: -rw-r--r-- 1,524 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
libsass
=========

[![Circle CI](https://circleci.com/gh/wellington/go-libsass.svg?style=svg)](https://circleci.com/gh/wellington/go-libsass) [![Build status](https://ci.appveyor.com/api/projects/status/uhl4swbb2r7lcfpc/branch/master?svg=true)](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)

```
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