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 NewBinaryWithVersion ¶
NewBinaryWithVersion creates a new Binary with a specific version.
func (*Binary) EnsureInstalled ¶
EnsureInstalled downloads the binary if it doesn't exist. Returns the path to the binary.
func (*Binary) IsInstalled ¶
IsInstalled checks if the binary is installed.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner manages running the Tailwind CLI.
func (*Runner) Build ¶
func (r *Runner) Build(ctx context.Context, cfg RunnerConfig) error
Build runs Tailwind CSS build (one-shot).
func (*Runner) StartWatch ¶
func (r *Runner) StartWatch(ctx context.Context, cfg RunnerConfig) error
StartWatch starts Tailwind in watch mode.
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.
Click to show internal directories.
Click to hide internal directories.