Documentation
¶
Overview ¶
Package libsass a SCSS transpiler to CSS using LibSASS.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { // Default is nested. OutputStyle OutputStyle // Precision of floating point math. Precision int // File paths to use to resolve imports. IncludePaths []string // ImportResolver can be used to supply a custom import resolver, both to redirect // to another URL or to return the body. ImportResolver func(url string, prev string) (newURL string, body string, resolved bool) // Used to indicate "old style" SASS for the input stream. SassSyntax bool SourceMapOptions SourceMapOptions }
type OutputStyle ¶
type OutputStyle int
const ( NestedStyle OutputStyle = iota ExpandedStyle CompactStyle CompressedStyle )
func ParseOutputStyle ¶ added in v0.3.0
func ParseOutputStyle(s string) OutputStyle
ParseOutputStyle will convert s into OutputStyle. Case insensitive, returns NestedStyle for unknown values.
type SourceMapOptions ¶ added in v0.4.0
type Transpiler ¶
Example ¶
package main import ( "fmt" "log" "github.com/bep/golibsass/libsass" ) func main() { transpiler, err := libsass.New(libsass.Options{OutputStyle: libsass.CompressedStyle}) if err != nil { log.Fatal(err) } result, err := transpiler.Execute(` $font-stack: Helvetica, sans-serif; $primary-color: #333; body { font: 100% $font-stack; color: $primary-color; } `) if err != nil { log.Fatal(err) } fmt.Println(result.CSS) }
Output: body{font:100% Helvetica,sans-serif;color:#333}
func New ¶
func New(options Options) (Transpiler, error)
New creates a new libsass transpiler configured with the given options.
Directories
¶
Path | Synopsis |
---|---|
Package libsasserrors holds the error types used by the libsass package.
|
Package libsasserrors holds the error types used by the libsass package. |
Click to show internal directories.
Click to hide internal directories.