Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
.github/ | H | 22-May-2021 | - | |||
gen/ | H | 22-May-2021 | - | |||
internal/libsass/ | H | 22-May-2021 | - | |||
libsass/ | H | 22-May-2021 | - | |||
libsass_src/ | H | 22-May-2021 | - | |||
.gitignore | H A D | 22-May-2021 | 39 | |||
.gitmodules | H A D | 22-May-2021 | 0 | |||
.travis.yml | H A D | 22-May-2021 | 1.1 KiB | |||
LICENSE | H A D | 22-May-2021 | 1.1 KiB | |||
NOTES | H A D | 22-May-2021 | 1.4 KiB | |||
README.md | H A D | 22-May-2021 | 2 KiB | |||
codecov.yml | H A D | 22-May-2021 | 142 | |||
go.mod | H A D | 22-May-2021 | 87 | |||
go.sum | H A D | 22-May-2021 | 738 | |||
pull-libsass.sh | H A D | 22-May-2021 | 172 |
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