package cssjs
import "github.com/gohugoio/hugo/resources/resource_transformers/cssjs"
Package cssjs provides resource transformations backed by some popular JS based frameworks.
Index ¶
- type InlineImports
- type PostCSSClient
- func NewPostCSSClient(rs *resources.Spec) *PostCSSClient
- func (c *PostCSSClient) Process(res resources.ResourceTransformer, options map[string]any) (resource.Resource, error)
- type PostCSSOptions
- type TailwindCSSClient
- func NewTailwindCSSClient(rs *resources.Spec) *TailwindCSSClient
- func (c *TailwindCSSClient) Process(res resources.ResourceTransformer, options map[string]any) (resource.Resource, error)
- type TailwindCSSOptions
Types ¶
type InlineImports ¶
type InlineImports struct {
// Enable inlining of @import statements.
// Does so recursively, but currently once only per file;
// that is, it's not possible to import the same file in
// different scopes (root, media query...)
// Note that this import routine does not care about the CSS spec,
// so you can have @import anywhere in the file.
InlineImports bool
// See issue https://github.com/gohugoio/hugo/issues/13719
// Disable inlining of @import statements
// This is currenty only used for css.TailwindCSS.
DisableInlineImports bool
// When InlineImports is enabled, we fail the build if an import cannot be resolved.
// You can enable this to allow the build to continue and leave the import statement in place.
// Note that the inline importer does not process url location or imports with media queries,
// so those will be left as-is even without enabling this option.
SkipInlineImportsNotFound bool
}
type PostCSSClient ¶
type PostCSSClient struct {
// contains filtered or unexported fields
}
PostCSSClient is the client used to do PostCSS transformations.
func NewPostCSSClient ¶
func NewPostCSSClient(rs *resources.Spec) *PostCSSClient
NewPostCSSClient creates a new PostCSSClient with the given specification.
func (*PostCSSClient) Process ¶
func (c *PostCSSClient) Process(res resources.ResourceTransformer, options map[string]any) (resource.Resource, error)
Process transforms the given Resource with the PostCSS processor.
type PostCSSOptions ¶
type PostCSSOptions struct {
// Set a custom path to look for a config file.
Config string
NoMap bool // Disable the default inline sourcemaps
InlineImports `mapstructure:",squash"`
// Options for when not using a config file
Use string // List of postcss plugins to use
Parser string // Custom postcss parser
Stringifier string // Custom postcss stringifier
Syntax string // Custom postcss syntax
}
Some of the options from https://github.com/postcss/postcss-cli
type TailwindCSSClient ¶
type TailwindCSSClient struct {
// contains filtered or unexported fields
}
Client is the client used to do TailwindCSS transformations.
func NewTailwindCSSClient ¶
func NewTailwindCSSClient(rs *resources.Spec) *TailwindCSSClient
NewTailwindCSSClient creates a new TailwindCSSClient with the given specification.
func (*TailwindCSSClient) Process ¶
func (c *TailwindCSSClient) Process(res resources.ResourceTransformer, options map[string]any) (resource.Resource, error)
Process transforms the given Resource with the TailwindCSS processor.
type TailwindCSSOptions ¶
type TailwindCSSOptions struct {
Minify bool // Optimize and minify the output
Optimize bool // Optimize the output without minifying
InlineImports `mapstructure:",squash"`
}
Source Files ¶
inline_imports.go postcss.go tailwindcss.go
- Version
- v0.153.4 (latest)
- Published
- Dec 28, 2025
- Platform
- linux/amd64
- Imports
- 25 packages
- Last checked
- 4 months ago –
Tools for package owners.