tailwind

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package tailwind manages the Tailwind CSS standalone binary. It handles downloading, caching, and running the binary without requiring Node.js.

Index

Constants

View Source
const (
	// Version is the Tailwind CSS version to use.
	// Update this when a new stable version is released.
	// Note: v4.0.0-v4.0.5 had a bug where --watch exited immediately.
	// See: https://github.com/rails/tailwindcss-rails/issues/475
	Version = "v4.1.18"

	// GitHubReleaseURL is the base URL for downloading Tailwind binaries.
	GitHubReleaseURL = "https://github.com/tailwindlabs/tailwindcss/releases/download"

	// DefaultBinDir is the default directory for storing the binary.
	DefaultBinDir = ".vango/bin"
)

Variables

This section is empty.

Functions

func PlatformName

func PlatformName() string

Types

type Binary

type Binary struct {
	// Version is the Tailwind version.
	Version string

	// BinDir is the directory where the binary is stored.
	BinDir string

	// DownloadBaseURL is the base URL for downloading Tailwind binaries.
	// If empty, GitHubReleaseURL is used.
	DownloadBaseURL string

	// HTTPClient is used for downloads. If nil, a default client is used.
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Binary represents the Tailwind CSS standalone binary.

func NewBinary

func NewBinary() *Binary

NewBinary creates a new Binary with default settings.

func NewBinaryWithVersion

func NewBinaryWithVersion(version string) *Binary

NewBinaryWithVersion creates a new Binary with a specific version.

func (*Binary) EnsureInstalled

func (b *Binary) EnsureInstalled(ctx context.Context, progress func(msg string)) (string, error)

EnsureInstalled downloads the binary if it doesn't exist. Returns the path to the binary.

func (*Binary) IsInstalled

func (b *Binary) IsInstalled() bool

IsInstalled checks if the binary is installed.

func (*Binary) Path

func (b *Binary) Path() (string, error)

Path returns the path to the Tailwind binary, downloading if necessary.

type Runner

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

Runner manages running the Tailwind CLI.

func NewRunner

func NewRunner(binary *Binary, projectDir string) *Runner

NewRunner creates a new Tailwind runner.

func (*Runner) Build

func (r *Runner) Build(ctx context.Context, cfg RunnerConfig) error

Build runs Tailwind CSS build (one-shot).

func (*Runner) IsRunning

func (r *Runner) IsRunning() bool

IsRunning returns whether Tailwind is running.

func (*Runner) StartWatch

func (r *Runner) StartWatch(ctx context.Context, cfg RunnerConfig) error

StartWatch starts Tailwind in watch mode.

func (*Runner) Stop

func (r *Runner) Stop()

Stop stops the Tailwind watcher.

type RunnerConfig

type RunnerConfig struct {
	// InputPath is the input CSS file path (relative to project).
	InputPath string

	// OutputPath is the output CSS file path (relative to project).
	OutputPath string

	// ConfigPath is the tailwind.config.js path (relative to project or absolute).
	// If empty, Tailwind uses its default config resolution.
	ConfigPath string

	// ProjectDir is the project directory.
	ProjectDir string

	// Minify enables CSS minification.
	Minify bool

	// Watch enables watch mode.
	Watch bool
}

RunnerConfig configures the Tailwind runner.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL