• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H22-May-2021-

gen/H22-May-2021-

internal/libsass/H22-May-2021-

libsass/H22-May-2021-

libsass_src/H22-May-2021-

.gitignoreH A D22-May-202139

.gitmodulesH A D22-May-20210

.travis.ymlH A D22-May-20211.1 KiB

LICENSEH A D22-May-20211.1 KiB

NOTESH A D22-May-20211.4 KiB

README.mdH A D22-May-20212 KiB

codecov.ymlH A D22-May-2021142

go.modH A D22-May-202187

go.sumH A D22-May-2021738

pull-libsass.shH A D22-May-2021172

README.md

1
2[![Build Status](https://travis-ci.org/bep/golibsass.svg?branch=master)](https://travis-ci.org/bep/golibsass)
3[![Go Report Card](https://goreportcard.com/badge/github.com/bep/golibsass)](https://goreportcard.com/report/github.com/bep/golibsass)
4[![LibSass Version](https://img.shields.io/badge/LibSass-v3.6.5-blue)](https://github.com/sass/libsass)
5[![codecov](https://codecov.io/gh/bep/golibsass/branch/master/graph/badge.svg)](https://codecov.io/gh/bep/golibsass)
6[![GoDoc](https://godoc.org/github.com/bep/golibsass/libsass?status.svg)](https://godoc.org/github.com/bep/golibsass/libsass)
7
8The primary motivation for this project is to provide `SCSS` support to [Hugo](https://gohugo.io/). I welcome PRs with bug fixes. I will also consider adding functionality, but please raise an issue discussing it first.
9
10If you need more functionality than this project can provide you may want to have a look at [go-libsass](https://github.com/wellington/go-libsass).
11
12## Usage
13
14A basic example (error handling omitted):
15
16```go
17transpiler, _ := libsass.New(libsass.Options{OutputStyle: libsass.CompressedStyle})
18
19result, _ := transpiler.Execute(`
20$font-stack:    Helvetica, sans-serif;
21$primary-color: #333;
22
23body {
24  font: 100% $font-stack;
25  color: $primary-color;
26}
27`)
28
29fmt.Println(result.CSS)
30// Output: body{font:100% Helvetica,sans-serif;color:#333}
31```
32
33See the [GoDoc](https://godoc.org/github.com/bep/golibsass/libsass) for more options.
34
35## Update LibSass version
36
37This project embeds the [LibSASS](https://github.com/sass/libsass) source code as a Git subtree. To update:
38
391. Pull in the relevant LibSASS version, e.g. `./pull-libsass.sh 3.6.3`
402. Regenerate wrappers with `go generate ./gen`
413. Update the LibSass version badge above.
42
43## Local development
44
45Compiling C++ code isn' particulary fast; if you install libsass on your PC you can link against that, useful during development.
46
47On a Mac you may do something like:
48
49```bash
50brew install --HEAD libsass
51go test ./libsass -tags dev
52```
53