tailwind

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tailwind manages the pinned Tailwind CSS standalone binary (REQ-STY-01). It downloads the binary for the host platform, verifies the sha256 from gx.lock and runs it. Node is never involved.

Index

Constants

View Source
const DefaultBaseURL = "https://github.com/tailwindlabs/tailwindcss/releases/download"

DefaultBaseURL is the release download root.

View Source
const DefaultVersion = "v4.3.3"

DefaultVersion is the pinned Tailwind release.

Variables

This section is empty.

Functions

func Asset

func Asset(goos, goarch string) (string, error)

Asset returns the release asset name of a GOOS and GOARCH.

Types

type Lock

type Lock struct {
	Tailwind LockEntry `json:"tailwind"`
}

Lock is the gx.lock shape. The file is machine-written.

func DefaultLock

func DefaultLock() Lock

DefaultLock returns the built-in pin of the official release.

func LoadLock

func LoadLock(root string) (Lock, error)

LoadLock reads gx.lock from a module root, or returns the default pin when the file is absent.

type LockEntry

type LockEntry struct {
	Version string            `json:"version"`
	SHA256  map[string]string `json:"sha256,omitempty"`
}

LockEntry pins one tool.

type Manager

type Manager struct {
	// Root is the module root that holds gx.lock and gx.toml.
	Root string
	// Cache overrides the binary cache directory.
	Cache string
	// BaseURL overrides the release download root, for mirrors (REQ-STY-12)
	// and tests.
	BaseURL string
	// Client is the HTTP client, or http.DefaultClient.
	Client *http.Client
}

Manager fetches and runs the pinned binary.

func (*Manager) Build

func (m *Manager) Build(ctx context.Context, themePath string, minify bool) ([]byte, error)

Build runs the pinned Tailwind binary on themePath and returns the CSS (REQ-STY-02). The output also lands in .gx/app.css.

func (*Manager) BuildInput added in v0.3.0

func (m *Manager) BuildInput(ctx context.Context, input []byte, dir, out string) ([]byte, error)

BuildInput runs the pinned binary on a stylesheet that it gets on the standard input, with dir as the working directory, and returns the minified CSS (REQ-ISL-11). The relative paths of the input start at dir.

func (*Manager) Ensure

func (m *Manager) Ensure(ctx context.Context) (string, error)

Ensure returns the path of the verified binary, downloading it when the cache is cold (REQ-STY-01).

func (*Manager) Run

func (m *Manager) Run(ctx context.Context, args ...string) ([]byte, error)

Run runs the pinned binary with args (REQ-STY-01). It returns the combined output.

func (*Manager) Vendor

func (m *Manager) Vendor(ctx context.Context) (string, error)

Vendor downloads the pinned binary into .gx/vendor for offline builds (REQ-STY-12).

Jump to

Keyboard shortcuts

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