package dartsass

import "github.com/gohugoio/hugo/resources/resource_transformers/tocss/dartsass"

Package dartsass integrates with the Dart Sass Embedded protocol to transpile SCSS/SASS.

Index

Functions

func Supports

func Supports() bool

Supports returns whether sass, dart-sass, or dart-sass-embedded is found in $PATH.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func (*Client) Close

func (c *Client) Close() error

func (*Client) ToCSS

func (c *Client) ToCSS(res resources.ResourceTransformer, args map[string]any) (resource.Resource, error)

type Options

type Options struct {
	// Hugo, will by default, just replace the extension of the source
	// to .css, e.g. "scss/main.scss" becomes "scss/main.css". You can
	// control this by setting this, e.g. "styles/main.css" will create
	// a Resource with that as a base for RelPermalink etc.
	TargetPath string

	// Hugo automatically adds the entry directories (where the main.scss lives)
	// for project and themes to the list of include paths sent to LibSASS.
	// Any paths set in this setting will be appended. Note that these will be
	// treated as relative to the working dir, i.e. no include paths outside the
	// project/themes.
	IncludePaths []string

	// Default is nested.
	// One of nested, expanded, compact, compressed.
	OutputStyle string

	// When enabled, Hugo will generate a source map.
	EnableSourceMap bool

	// If enabled, sources will be embedded in the generated source map.
	SourceMapIncludeSources bool

	// Vars will be available in 'hugo:vars', e.g:
	//     @use "hugo:vars";
	//     $color: vars.$color;
	Vars map[string]any

	// Deprecations IDs in this slice will be silenced.
	// The IDs can be found in the Dart Sass log output, e.g. "import" in
	//    WARN  Dart Sass: DEPRECATED [import].
	SilenceDeprecations []string
}

Source Files

client.go transform.go

Version
v0.144.2 (latest)
Published
Feb 19, 2025
Platform
linux/amd64
Imports
22 packages
Last checked
13 hours ago

Tools for package owners.