Documentation
¶
Overview ¶
Package sass is a thin Ruby-facing adapter over the pure-Go Sass/SCSS compiler github.com/go-scss/scss. It exposes the modern sass-embedded gem surface — Sass.compile_string(source, syntax:, style:, load_paths:, ...) and Sass.compile(path, ...) returning {css, loaded_urls, source_map} — in a shape the rbgo binding wraps directly, plus the legacy SassC::Engine API (see the sassc subpackage).
This module is intentionally minimal: it maps Ruby keyword arguments to the engine's typed options, calls the engine, and returns a result whose fields mirror the gem's CompileResult (`css`, `loaded_urls`, `source_map`).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompileResult ¶
CompileResult mirrors the gem's Sass::CompileResult: css, loaded_urls, and source_map (source maps are not yet emitted; see the engine residuals).
func Compile ¶
func Compile(path string, opts *Options) (*CompileResult, error)
Compile compiles a Sass/SCSS file, mirroring Sass.compile.
func CompileString ¶
func CompileString(source string, opts *Options) (*CompileResult, error)
CompileString compiles Sass/SCSS source text, mirroring Sass.compile_string. This is the entry point Jekyll's jekyll-sass-converter calls.
type Options ¶
type Options struct {
// Syntax is honored by CompileString; Compile infers it from the file
// extension unless overridden.
Syntax Syntax
Style Style
LoadPaths []string
// Importer, when non-nil, resolves @use/@forward/@import URLs. It mirrors a
// custom Ruby importer: given a URL it returns the source, a canonical URL,
// and whether it handled the request.
Importer func(url string) (source string, canonicalURL string, ok bool)
}
Options mirrors the sass-embedded keyword arguments common to compile and compile_string. Zero values match the gem defaults (SCSS, expanded).
Directories
¶
| Path | Synopsis |
|---|---|
|
Package sassc mirrors the legacy SassC gem surface — SassC::Engine.new( template, style:).render — layered over the same pure-Go engine, since real applications still use both the modern sass-embedded and the older sassc API.
|
Package sassc mirrors the legacy SassC gem surface — SassC::Engine.new( template, style:).render — layered over the same pure-Go engine, since real applications still use both the modern sass-embedded and the older sassc API. |