Documentation
¶
Index ¶
- Variables
- func For(lists ...ClassList) (*css.Sheet, error)
- func RoleVars() *css.Sheet
- func Rules(classes ...string) (*css.Sheet, error)
- type BorderStyle
- type BorderWidth
- type Breakpoint
- type ClassList
- func (cl ClassList) Accent(c Color) ClassList
- func (cl ClassList) AnimatePulse() ClassList
- func (cl ClassList) AnimateSpin() ClassList
- func (cl ClassList) AppearanceNone() ClassList
- func (cl ClassList) AspectSquare() ClassList
- func (cl ClassList) AspectVideo() ClassList
- func (cl ClassList) Bg(c Color) ClassList
- func (cl ClassList) BgOpacity(c Color, opacity string) ClassList
- func (cl ClassList) Border(b BorderWidth) ClassList
- func (cl ClassList) BorderBottom(b BorderWidth) ClassList
- func (cl ClassList) BorderBottomColor(c Color) ClassList
- func (cl ClassList) BorderColor(c Color) ClassList
- func (cl ClassList) BorderLeft(b BorderWidth) ClassList
- func (cl ClassList) BorderLeftColor(c Color) ClassList
- func (cl ClassList) BorderRight(b BorderWidth) ClassList
- func (cl ClassList) BorderRightColor(c Color) ClassList
- func (cl ClassList) BorderStyle(b BorderStyle) ClassList
- func (cl ClassList) BorderTop(b BorderWidth) ClassList
- func (cl ClassList) BorderTopColor(c Color) ClassList
- func (cl ClassList) Bottom(s Spacing) ClassList
- func (cl ClassList) BottomOffset(v PositionOffset) ClassList
- func (cl ClassList) BreakAll() ClassList
- func (cl ClassList) BreakWords() ClassList
- func (cl ClassList) Breakpoint(bp Breakpoint, build func(ClassList) ClassList) ClassList
- func (cl ClassList) Capitalize() ClassList
- func (cl ClassList) ColSpan(n int) ClassList
- func (cl ClassList) ColSpanFull() ClassList
- func (cl ClassList) Compile() string
- func (cl ClassList) Cursor(c Cursor) ClassList
- func (cl ClassList) Display(d Display) ClassList
- func (cl ClassList) DivideX(s Spacing) ClassList
- func (cl ClassList) DivideY(s Spacing) ClassList
- func (cl ClassList) Duration(d Duration) ClassList
- func (cl ClassList) Easing(e Easing) ClassList
- func (cl ClassList) Flex1() ClassList
- func (cl ClassList) FlexDir(f FlexDir) ClassList
- func (cl ClassList) FlexGrow() ClassList
- func (cl ClassList) FlexGrow0() ClassList
- func (cl ClassList) FlexNoWrap() ClassList
- func (cl ClassList) FlexNone() ClassList
- func (cl ClassList) FlexShrink0() ClassList
- func (cl ClassList) FlexWrap() ClassList
- func (cl ClassList) FontFamily(f FontFamily) ClassList
- func (cl ClassList) FontSize(f FontSize) ClassList
- func (cl ClassList) FontWeight(f FontWeight) ClassList
- func (cl ClassList) Gap(s Spacing) ClassList
- func (cl ClassList) GapX(s Spacing) ClassList
- func (cl ClassList) GapY(s Spacing) ClassList
- func (cl ClassList) GridCols(n int) ClassList
- func (cl ClassList) Group() ClassList
- func (cl ClassList) Height(s Spacing) ClassList
- func (cl ClassList) HeightViewport(v ViewportHeight) ClassList
- func (cl ClassList) Inset(s Spacing) ClassList
- func (cl ClassList) InsetX(s Spacing) ClassList
- func (cl ClassList) InsetY(s Spacing) ClassList
- func (cl ClassList) IsEmpty() bool
- func (cl ClassList) Italic() ClassList
- func (cl ClassList) Items(i Items) ClassList
- func (cl ClassList) Justify(j Justify) ClassList
- func (cl ClassList) Leading(l Leading) ClassList
- func (cl ClassList) Left(s Spacing) ClassList
- func (cl ClassList) LeftOffset(v PositionOffset) ClassList
- func (cl ClassList) LineClamp(n int) ClassList
- func (cl ClassList) LineThrough() ClassList
- func (cl ClassList) ListStyle(style string) ClassList
- func (cl ClassList) Lowercase() ClassList
- func (cl ClassList) Margin(s Spacing) ClassList
- func (cl ClassList) MarginBottom(s Spacing) ClassList
- func (cl ClassList) MarginLeft(s Spacing) ClassList
- func (cl ClassList) MarginRight(s Spacing) ClassList
- func (cl ClassList) MarginTop(s Spacing) ClassList
- func (cl ClassList) MarginX(s Spacing) ClassList
- func (cl ClassList) MarginY(s Spacing) ClassList
- func (cl ClassList) MaxHeight(s Spacing) ClassList
- func (cl ClassList) MaxHeightViewport(v ViewportHeight) ClassList
- func (cl ClassList) MaxWScaled(name MaxWidth) ClassList
- func (cl ClassList) Merge(other ClassList) ClassList
- func (cl ClassList) MinHeight(s Spacing) ClassList
- func (cl ClassList) MinHeightScreen() ClassList
- func (cl ClassList) MinWidth(s Spacing) ClassList
- func (cl ClassList) NegBottom(s Spacing) ClassList
- func (cl ClassList) NegLeft(s Spacing) ClassList
- func (cl ClassList) NegMargin(side string, s Spacing) ClassList
- func (cl ClassList) NegRight(s Spacing) ClassList
- func (cl ClassList) NegTop(s Spacing) ClassList
- func (cl ClassList) NoLineThrough() ClassList
- func (cl ClassList) NoUnderline() ClassList
- func (cl ClassList) NormalCase() ClassList
- func (cl ClassList) NotItalic() ClassList
- func (cl ClassList) NotSrOnly() ClassList
- func (cl ClassList) ObjectContain() ClassList
- func (cl ClassList) ObjectCover() ClassList
- func (cl ClassList) On(state State, build func(ClassList) ClassList) ClassList
- func (cl ClassList) Opacity(o Opacity) ClassList
- func (cl ClassList) Outline(o Outline) ClassList
- func (cl ClassList) Overflow(o Overflow) ClassList
- func (cl ClassList) OverflowX(o Overflow) ClassList
- func (cl ClassList) OverflowY(o Overflow) ClassList
- func (cl ClassList) OverscrollContain() ClassList
- func (cl ClassList) Padding(s Spacing) ClassList
- func (cl ClassList) PaddingBottom(s Spacing) ClassList
- func (cl ClassList) PaddingLeft(s Spacing) ClassList
- func (cl ClassList) PaddingRight(s Spacing) ClassList
- func (cl ClassList) PaddingTop(s Spacing) ClassList
- func (cl ClassList) PaddingX(s Spacing) ClassList
- func (cl ClassList) PaddingY(s Spacing) ClassList
- func (cl ClassList) Peer() ClassList
- func (cl ClassList) PointerEvents(p PointerEvents) ClassList
- func (cl ClassList) Position(p Position) ClassList
- func (cl ClassList) Raw(classes string) ClassList
- func (cl ClassList) Relative() ClassList
- func (cl ClassList) Resize(mode ResizeMode) ClassList
- func (cl ClassList) ResizeNone() ClassList
- func (cl ClassList) ResizeY() ClassList
- func (cl ClassList) Right(s Spacing) ClassList
- func (cl ClassList) RightOffset(v PositionOffset) ClassList
- func (cl ClassList) Ring(r RingWidth) ClassList
- func (cl ClassList) RingColor(c Color) ClassList
- func (cl ClassList) RingInset() ClassList
- func (cl ClassList) RingOffset(r RingOffset) ClassList
- func (cl ClassList) Rotate(deg string) ClassList
- func (cl ClassList) Rounded(r Radius) ClassList
- func (cl ClassList) RoundedBottom(r Radius) ClassList
- func (cl ClassList) RoundedLeft(r Radius) ClassList
- func (cl ClassList) RoundedRight(r Radius) ClassList
- func (cl ClassList) RoundedTop(r Radius) ClassList
- func (cl ClassList) Shadow(s Shadow) ClassList
- func (cl ClassList) SpaceX(s Spacing) ClassList
- func (cl ClassList) SpaceY(s Spacing) ClassList
- func (cl ClassList) SrOnly() ClassList
- func (cl ClassList) TabularNums() ClassList
- func (cl ClassList) TextAlign(t TextAlign) ClassList
- func (cl ClassList) TextColor(c Color) ClassList
- func (cl ClassList) Top(s Spacing) ClassList
- func (cl ClassList) TopOffset(v PositionOffset) ClassList
- func (cl ClassList) Tracking(t Tracking) ClassList
- func (cl ClassList) Transform() ClassList
- func (cl ClassList) Transition(t Transition) ClassList
- func (cl ClassList) TranslateX(t Translate) ClassList
- func (cl ClassList) TranslateXStep(s Spacing) ClassList
- func (cl ClassList) TranslateY(t Translate) ClassList
- func (cl ClassList) TranslateYStep(s Spacing) ClassList
- func (cl ClassList) Truncate() ClassList
- func (cl ClassList) Underline() ClassList
- func (cl ClassList) UnderlineOffset(step Spacing) ClassList
- func (cl ClassList) Uppercase() ClassList
- func (cl ClassList) UserSelect(s Select) ClassList
- func (cl ClassList) WhitespaceNowrap() ClassList
- func (cl ClassList) WhitespacePreWrap() ClassList
- func (cl ClassList) Width(s Spacing) ClassList
- func (cl ClassList) ZIndex(z ZLayer) ClassList
- func (cl ClassList) ZLayer(z ZLayer) ClassList
- type Color
- type Cursor
- type Display
- type Duration
- type Easing
- type FlexDir
- type FontFamily
- type FontSize
- type FontWeight
- type Items
- type Justify
- type Leading
- type MaxWidth
- type Opacity
- type Outline
- type Overflow
- type PointerEvents
- type Position
- type PositionOffset
- type Radius
- type ResizeMode
- type RingOffset
- type RingWidth
- type Select
- type Shadow
- type Spacing
- type State
- type TextAlign
- type Tracking
- type Transition
- type Translate
- type ViewportHeight
- type ZLayer
Constants ¶
This section is empty.
Variables ¶
var ErrUnknownClass = errors.New("emission: class is not part of tw's enumerable universe")
ErrUnknownClass reports a class outside the enumerable universe.
var ErrUnsupportedState = errors.New("emission: state prefix has no CSS mapping")
ErrUnsupportedState reports a state prefix with no defined CSS mapping yet.
Functions ¶
func For ¶
For emits the rules for exactly the classes the given lists compile to, prefixed variants included. This is the deterministic, Go-native alternative to source scanning: components declare their ClassLists, and the stylesheet is derived from those declarations.
Types ¶
type BorderStyle ¶
type BorderStyle string
BorderStyle is a typed border-style utility (dashed / solid / dotted). The Border() method sets width + base "border"; BorderStyle() layers the style on top.
const ( BorderSolid BorderStyle = "solid" BorderDashed BorderStyle = "dashed" BorderDotted BorderStyle = "dotted" BorderDouble BorderStyle = "double" BorderHidden BorderStyle = "hidden" BorderNone BorderStyle = "none" )
func AllBorderStyles ¶
func AllBorderStyles() []BorderStyle
AllBorderStyles returns every BorderStyle const in stable order.
type BorderWidth ¶
type BorderWidth string
BorderWidth is a typed border thickness step.
const ( Border0 BorderWidth = "0" Border1 BorderWidth = "" // base `border` class, no suffix Border2 BorderWidth = "2" // border-2 Border4 BorderWidth = "4" Border8 BorderWidth = "8" )
func AllBorderWidths ¶
func AllBorderWidths() []BorderWidth
AllBorderWidths returns every BorderWidth in stable order.
type Breakpoint ¶
type Breakpoint string
Breakpoint is a typed responsive breakpoint (Tailwind defaults).
const ( BreakpointSM Breakpoint = "sm" // >= 640px BreakpointLG Breakpoint = "lg" // >= 1024px )
The two breakpoints this application lays out at. Three more were declared and nothing ever named one; a component that needs md:, xl: or 2xl: adds it back where it uses it.
func (Breakpoint) Prefix ¶
func (b Breakpoint) Prefix() string
Prefix returns the Tailwind breakpoint prefix including the trailing colon, e.g. "sm:". Zero value returns empty string (no prefix).
type ClassList ¶
type ClassList struct {
// contains filtered or unexported fields
}
ClassList is an immutable, composable typed builder for Tailwind class strings. Every method returns a new ClassList; the builder itself holds no resolved strings until Compile() is called.
The IR is a flat slice of segments. A segment is either:
- A utility class (resolved at append time, already a string)
- A prefix frame (opens a group like "hover:") and its end marker
This flat design lets Compile() walk the segments once, tracking the active prefix stack, and emit the final space-separated output in O(n).
func (ClassList) Accent ¶
Accent applies an accent color (Tailwind's "accent-*"). Used by form controls like range inputs and checkboxes to tint the native chrome with a design-system color.
func (ClassList) AnimatePulse ¶
AnimatePulse applies Tailwind's "animate-pulse" utility.
func (ClassList) AnimateSpin ¶
AnimateSpin applies Tailwind's "animate-spin" utility.
func (ClassList) AppearanceNone ¶
AppearanceNone removes native OS chrome from form controls.
func (ClassList) AspectSquare ¶
AspectSquare / AspectVideo set aspect-ratio.
func (ClassList) AspectVideo ¶
func (ClassList) BgOpacity ¶
BgOpacity sets a background color with an alpha modifier, e.g. Bg(SurfaceOverlay, "75") → "bg-surface-overlay/75".
func (ClassList) Border ¶
func (cl ClassList) Border(b BorderWidth) ClassList
Border applies a border width (use BorderColor for the color). The zero BorderWidth (Border1) emits the base "border" class.
func (ClassList) BorderBottom ¶
func (cl ClassList) BorderBottom(b BorderWidth) ClassList
func (ClassList) BorderBottomColor ¶
func (ClassList) BorderColor ¶
BorderColor applies a border color.
func (ClassList) BorderLeft ¶
func (cl ClassList) BorderLeft(b BorderWidth) ClassList
func (ClassList) BorderLeftColor ¶
func (ClassList) BorderRight ¶
func (cl ClassList) BorderRight(b BorderWidth) ClassList
func (ClassList) BorderRightColor ¶
func (ClassList) BorderStyle ¶
func (cl ClassList) BorderStyle(b BorderStyle) ClassList
BorderStyle applies a border-style utility (e.g., border-dashed). Use alongside Border() for width and BorderColor() for color.
func (ClassList) BorderTop ¶
func (cl ClassList) BorderTop(b BorderWidth) ClassList
BorderTop / BorderBottom / BorderLeft / BorderRight apply a one-side border width. Pass Border1 for the default thickness.
func (ClassList) BorderTopColor ¶
BorderTopColor / BorderBottomColor / BorderLeftColor / BorderRightColor apply a per-side border color, e.g. BorderTopColor(ColorWhite) → "border-t-white". Use alongside BorderTop etc. for the width.
func (ClassList) BottomOffset ¶
func (cl ClassList) BottomOffset(v PositionOffset) ClassList
func (ClassList) BreakAll ¶
BreakAll lets a browser break a line at any character (Tailwind's "break-all"). Use for user-supplied long tokens like hashes / URLs.
func (ClassList) BreakWords ¶
BreakWords allows long words to break.
func (ClassList) Breakpoint ¶
func (cl ClassList) Breakpoint(bp Breakpoint, build func(ClassList) ClassList) ClassList
Breakpoint wraps the build function's output in a responsive prefix (e.g., "sm:"). Nested Breakpoint calls are supported.
func (ClassList) Capitalize ¶
func (ClassList) ColSpan ¶
ColSpan applies a CSS grid column span ("col-span-N"). N must be positive; 0 or negative → empty.
func (ClassList) ColSpanFull ¶
ColSpanFull emits Tailwind's "col-span-full" — span every column of the current grid regardless of column count. Distinct from ColSpan(N) which takes a numeric count.
func (ClassList) Compile ¶
Compile resolves the builder into a space-separated Tailwind class string. Output is deterministic and matches the append order. Prefix frames apply their prefix to each utility class between the open/close markers.
func (ClassList) DivideX ¶
DivideX / DivideY add borders between adjacent children. Pass empty Spacing for default; pass a Spacing const for a specific width.
func (ClassList) FlexNoWrap ¶
FlexNoWrap forces all flex children onto a single line — Tailwind's "flex-nowrap" utility. Use alongside Overflow to show a scroll when items exceed the container.
func (ClassList) FlexNone ¶
FlexGrow / FlexGrow0 toggle the flex-grow property. FlexNone prevents a flex child from growing or shrinking — Tailwind's "flex-none" utility.
func (ClassList) FlexShrink0 ¶
FlexShrink0 prevents a flex child from shrinking below its intrinsic size — Tailwind's "flex-shrink-0" utility.
func (ClassList) FlexWrap ¶
FlexWrap allows flex children to wrap to the next line — Tailwind's "flex-wrap" utility. Complements FlexDir for multi-line flex rows.
func (ClassList) FontFamily ¶
func (cl ClassList) FontFamily(f FontFamily) ClassList
FontFamily applies a font-family (Tailwind's font-sans/serif/mono).
func (ClassList) FontWeight ¶
func (cl ClassList) FontWeight(f FontWeight) ClassList
FontWeight applies a font-weight.
func (ClassList) GridCols ¶
GridCols applies a CSS grid template with N equally-sized columns ("grid-cols-N"). Use together with Display(DisplayGrid).
func (ClassList) Group ¶
Group / Peer apply Tailwind's variant-enabler utilities. A parent with `group` exposes `group-hover:*` / `group-focus:*` to descendants; `peer` does the same for siblings via `peer-*`.
func (ClassList) HeightViewport ¶
func (cl ClassList) HeightViewport(v ViewportHeight) ClassList
HeightViewport sets a height from the governed viewport-relative scale.
func (ClassList) LeftOffset ¶
func (cl ClassList) LeftOffset(v PositionOffset) ClassList
LeftOffset / RightOffset / TopOffset / BottomOffset apply one governed fractional overlay position. Unlike the Raw forms, every accepted value is part of emission's closed utility universe.
func (ClassList) LineClamp ¶
LineClamp truncates a paragraph after N lines (Tailwind's "line-clamp-N"). Use N >= 1; N == 0 emits "line-clamp-none".
func (ClassList) LineThrough ¶
LineThrough / NotLineThrough set the line-through text-decoration.
func (ClassList) MarginBottom ¶
func (ClassList) MarginLeft ¶
MarginLeft / MarginRight / MarginTop / MarginBottom — per-side margin.
func (ClassList) MarginRight ¶
func (ClassList) MaxHeightViewport ¶
func (cl ClassList) MaxHeightViewport(v ViewportHeight) ClassList
MaxHeightViewport sets a max-height from the governed viewport-relative scale.
func (ClassList) MaxWScaled ¶
MaxWScaled applies Tailwind's named max-width scale via a typed handle. Distinct from MaxW which takes an untyped string.
func (ClassList) MinHeightScreen ¶
MinHeightScreen is min-h-screen: at least the viewport. It is not a Spacing step, so it is a method of its own rather than a value MinHeight takes.
func (ClassList) NegMargin ¶
NegMargin sets a negative margin on the requested side. side is one of "" (all sides), "t", "b", "l", "r", "x", "y".
func (ClassList) NegTop ¶
NegTop / NegRight / NegBottom / NegLeft apply a negative positional offset on the Spacing scale (e.g., NegTop(tw.S1) emits "-top-1"). Used by badge and pill patterns that sit outside the parent's bounding box.
func (ClassList) NoLineThrough ¶
func (ClassList) NoUnderline ¶
NoUnderline removes underline text-decoration.
func (ClassList) NormalCase ¶
func (ClassList) NotSrOnly ¶
NotSrOnly undoes SrOnly, which is what a skip link needs: hidden until it is focused, and then a real control in the corner of the page.
func (ClassList) ObjectContain ¶
ObjectContain applies Tailwind's "object-contain" utility — scales the content to fit without cropping.
func (ClassList) ObjectCover ¶
ObjectCover is a shorthand for ObjectFit("cover").
func (ClassList) On ¶
On wraps the build function's output in a state prefix (e.g., "hover:"). Nested On calls are supported and prefixes stack in order.
func (ClassList) OverscrollContain ¶
OverscrollContain sets overscroll-behavior to contain (Tailwind's "overscroll-contain"). Prevents scroll chaining out of a container.
func (ClassList) PaddingBottom ¶
func (ClassList) PaddingLeft ¶
PaddingLeft / PaddingRight / PaddingTop / PaddingBottom — per-side padding.
func (ClassList) PaddingRight ¶
func (ClassList) PaddingTop ¶
func (ClassList) PointerEvents ¶
func (cl ClassList) PointerEvents(p PointerEvents) ClassList
PointerEvents applies a pointer-events style.
func (ClassList) Raw ¶
Raw is the escape hatch. Pass pre-audited Tailwind classes straight through. Use only for runtime-computed values (e.g., HTMX attributes) or incremental migration; the typed tables and All* enumerators linter watches this.
func (ClassList) Resize ¶
func (cl ClassList) Resize(mode ResizeMode) ClassList
Resize applies a textarea-resize mode (`none` / `y` / `x` / `both`).
func (ClassList) ResizeNone ¶
ResizeNone is a shorthand for Resize(ResizeModeNone): disables the textarea resize handle entirely.
func (ClassList) ResizeY ¶
ResizeY is a shorthand for Resize(ResizeModeY): allows vertical resize only (the default for auto-grow textareas).
func (ClassList) RightOffset ¶
func (cl ClassList) RightOffset(v PositionOffset) ClassList
func (ClassList) RingInset ¶
RingInset makes the focus ring draw on the inside edge of the element — Tailwind's "ring-inset" utility.
func (ClassList) RingOffset ¶
func (cl ClassList) RingOffset(r RingOffset) ClassList
RingOffset applies a ring offset width.
func (ClassList) Rotate ¶
Rotate sets a Tailwind rotate-* transform. deg is a numeric step like "45", "90", "180" matching the Tailwind rotate scale.
func (ClassList) RoundedBottom ¶
func (ClassList) RoundedLeft ¶
func (ClassList) RoundedRight ¶
func (ClassList) RoundedTop ¶
RoundedTop / RoundedBottom / RoundedLeft / RoundedRight apply a per-side border-radius step. Use Rounded(...) for all four corners.
func (ClassList) SpaceX ¶
SpaceX / SpaceY add horizontal / vertical spacing between adjacent sibling elements (Tailwind's "space-x-*" / "space-y-*").
func (ClassList) TabularNums ¶
TabularNums applies Tailwind's "tabular-nums" font-variant-numeric utility — forces fixed-width digits, used by counter displays.
func (ClassList) TextColor ¶
TextColor applies a foreground color. (Named TextColor rather than Text to avoid collision with FontSize.)
func (ClassList) Top ¶
Positional offsets. Apply to an absolutely/fixed positioned element (call Position first). Use Spacing consts (including SPX/S0) so the offset flows from the same scale as padding/margin.
func (ClassList) TopOffset ¶
func (cl ClassList) TopOffset(v PositionOffset) ClassList
func (ClassList) Transform ¶
Transform opts the element into Tailwind's transform utility surface. Required when applying translate/rotate/scale via utility classes in Tailwind v2-compatible output.
func (ClassList) Transition ¶
func (cl ClassList) Transition(t Transition) ClassList
Transition applies a transition property group.
func (ClassList) TranslateX ¶
TranslateX applies a horizontal translate via the Translate enum.
func (ClassList) TranslateXStep ¶
TranslateXStep applies a horizontal translate using the Spacing scale (e.g., tw.S5 → "translate-x-5"). Use this when the offset lines up with the platform spacing scale; use TranslateX for negative/fractional offsets outside the scale.
func (ClassList) TranslateY ¶
TranslateY applies a vertical translate via the Translate enum (handles negative offsets like TranslateNeg05).
func (ClassList) TranslateYStep ¶
TranslateYStep — vertical equivalent of TranslateXStep.
func (ClassList) UnderlineOffset ¶
UnderlineOffset sets the underline offset (Tailwind's "underline-offset-N"). Use the Spacing const names (S4, S8) for semantic offsets, or supply a raw numeric step if the design uses a non-standard value.
func (ClassList) Uppercase ¶
Uppercase / Lowercase / Capitalize / NormalCase set text-transform. NormalCase is the default text-transform (no transform) and is required when a base class carries uppercase/lowercase/capitalize and a specific slot wants to reset to the element's natural case.
func (ClassList) UserSelect ¶
UserSelect applies a user-select style.
func (ClassList) WhitespaceNowrap ¶
WhitespaceNowrap prevents text wrapping.
func (ClassList) WhitespacePreWrap ¶
WhitespacePreWrap preserves user whitespace and wraps long lines — Tailwind's "whitespace-pre-wrap" utility. Used by transcript and console bubbles that render AI output with embedded newlines.
type Color ¶
type Color string
Color is a typed semantic color role. Values serialize to the semantic token name (e.g., "surface-primary"), not a Tailwind class fragment. The ClassList builder combines a Color with its role (background, text, border, ring) to produce the final Tailwind class.
const ( SurfacePrimary Color = "surface-primary" SurfaceSecondary Color = "surface-secondary" SurfaceTertiary Color = "surface-tertiary" SurfaceBrand Color = "surface-brand" SurfaceBrandHover Color = "surface-brand-hover" SurfaceBrandSoft Color = "surface-brand-soft" SurfaceSuccess Color = "surface-success" SurfaceSuccessSoft Color = "surface-success-soft" SurfaceWarning Color = "surface-warning" SurfaceWarningSoft Color = "surface-warning-soft" SurfaceDanger Color = "surface-danger" SurfaceDangerSoft Color = "surface-danger-soft" SurfaceInfo Color = "surface-info" SurfaceInfoSoft Color = "surface-info-soft" SurfaceDisabled Color = "surface-disabled" SurfaceHover Color = "surface-hover" SurfaceActive Color = "surface-active" SurfaceOverlay Color = "surface-overlay" SurfaceInverse Color = "surface-inverse" )
Surface colors — backgrounds and filled surfaces.
const ( FgPrimary Color = "fg-primary" FgSecondary Color = "fg-secondary" FgTertiary Color = "fg-tertiary" FgMuted Color = "fg-muted" FgPlaceholder Color = "fg-placeholder" FgBrand Color = "fg-brand" FgOnBrand Color = "fg-on-brand" FgSuccess Color = "fg-success" FgWarning Color = "fg-warning" FgDanger Color = "fg-danger" FgInfo Color = "fg-info" FgDisabled Color = "fg-disabled" FgOnSurface Color = "fg-on-surface" FgOnInverse Color = "fg-on-inverse" FgLink Color = "fg-link" FgLinkHover Color = "fg-link-hover" )
Foreground colors — text and icons.
const ( BorderPrimary Color = "border-primary" BorderSecondary Color = "border-secondary" BorderBrand Color = "border-brand" BorderSuccess Color = "border-success" BorderWarning Color = "border-warning" BorderDanger Color = "border-danger" BorderInfo Color = "border-info" )
Border colors — divider lines and outlines.
const ( RingBrand Color = "ring-brand" RingFocus Color = "ring-focus" RingDanger Color = "ring-danger" )
Ring colors — focus ring and highlights.
ColorWhite / ColorBlack are Tailwind's plain neutral colors. Prefer the semantic Fg/Surface family; use these only for hard-coded contrast cases like a button's fill-on-brand text.
const ColorTransparent Color = "transparent"
ColorSpecialTransparent is a sentinel for `transparent` backgrounds. Used when a variant needs to explicitly disable a color slot (e.g., ghost/link buttons have transparent backgrounds). It compiles to "bg-transparent", "text-transparent", etc. depending on role.
type Cursor ¶
type Cursor string
Cursor is a typed cursor style.
const ( CursorAuto Cursor = "auto" CursorDefault Cursor = "default" CursorPointer Cursor = "pointer" CursorWait Cursor = "wait" CursorText Cursor = "text" CursorMove Cursor = "move" CursorHelp Cursor = "help" CursorNotAllowed Cursor = "not-allowed" CursorProgress Cursor = "progress" CursorCrosshair Cursor = "crosshair" CursorGrab Cursor = "grab" CursorGrabbing Cursor = "grabbing" )
type Display ¶
type Display string
Display is a typed CSS display mode.
func AllDisplays ¶
func AllDisplays() []Display
AllDisplays returns every Display const in stable order.
type Duration ¶
type Duration string
Duration is a typed transition duration step.
func AllDurations ¶
func AllDurations() []Duration
AllDurations returns every Duration const in stable order.
type FlexDir ¶
type FlexDir string
FlexDir is a typed flex-direction.
func AllFlexDirs ¶
func AllFlexDirs() []FlexDir
AllFlexDirs returns every FlexDir const in stable order.
type FontFamily ¶
type FontFamily string
FontFamily is a typed font-family utility (Tailwind's font-sans / font-serif / font-mono).
const ( FontSans FontFamily = "sans" FontSerif FontFamily = "serif" FontMono FontFamily = "mono" )
func AllFontFamilies ¶
func AllFontFamilies() []FontFamily
AllFontFamilies returns every FontFamily const in stable order.
type FontSize ¶
type FontSize string
FontSize is a typed type-scale level matching tokens.TypographyScale.
const ( TextXS FontSize = "xs" TextSM FontSize = "sm" TextBase FontSize = "base" TextLG FontSize = "lg" TextXL FontSize = "xl" Text2XL FontSize = "2xl" Text3XL FontSize = "3xl" Text4XL FontSize = "4xl" Text5XL FontSize = "5xl" Text6XL FontSize = "6xl" Text7XL FontSize = "7xl" Text8XL FontSize = "8xl" Text9XL FontSize = "9xl" )
func AllFontSizes ¶
func AllFontSizes() []FontSize
AllFontSizes returns every FontSize const in stable order.
type FontWeight ¶
type FontWeight string
FontWeight is a typed font-weight step.
const ( FontThin FontWeight = "thin" // 100 FontExtralight FontWeight = "extralight" // 200 FontLight FontWeight = "light" // 300 FontNormal FontWeight = "normal" // 400 FontMedium FontWeight = "medium" // 500 FontSemibold FontWeight = "semibold" // 600 FontBold FontWeight = "bold" // 700 FontExtrabold FontWeight = "extrabold" // 800 FontBlack FontWeight = "black" // 900 )
func AllFontWeights ¶
func AllFontWeights() []FontWeight
AllFontWeights returns every FontWeight const in stable order.
type Justify ¶
type Justify string
Justify maps to justify-content.
func AllJustify ¶
func AllJustify() []Justify
AllJustify returns every Justify const in stable order.
type Leading ¶
type Leading string
Leading is a typed line-height step.
func AllLeadings ¶
func AllLeadings() []Leading
AllLeadings returns every Leading const in stable order.
type MaxWidth ¶
type MaxWidth string
MaxWidth is a typed handle for Tailwind's named max-width scale. Values serialize to the Tailwind key ("sm", "2xl", "full") and flow through ClassList.MaxWScaled to produce the "max-w-<key>" utility.
const ( MaxWXS MaxWidth = "xs" MaxWSM MaxWidth = "sm" MaxWMD MaxWidth = "md" MaxWLG MaxWidth = "lg" MaxWXL MaxWidth = "xl" MaxW2XL MaxWidth = "2xl" MaxW3XL MaxWidth = "3xl" MaxW4XL MaxWidth = "4xl" MaxW5XL MaxWidth = "5xl" MaxW6XL MaxWidth = "6xl" MaxW7XL MaxWidth = "7xl" MaxWFull MaxWidth = "full" MaxWNone MaxWidth = "none" MaxWScreen MaxWidth = "screen" MaxWProse MaxWidth = "prose" )
type Opacity ¶
type Opacity string
Opacity is a typed opacity percentage step.
const ( Opacity0 Opacity = "0" Opacity5 Opacity = "5" Opacity10 Opacity = "10" Opacity20 Opacity = "20" Opacity25 Opacity = "25" Opacity30 Opacity = "30" Opacity40 Opacity = "40" Opacity50 Opacity = "50" Opacity60 Opacity = "60" Opacity70 Opacity = "70" Opacity75 Opacity = "75" Opacity80 Opacity = "80" Opacity90 Opacity = "90" Opacity95 Opacity = "95" Opacity100 Opacity = "100" )
func AllOpacities ¶
func AllOpacities() []Opacity
AllOpacities returns every Opacity in stable order.
type Overflow ¶
type Overflow string
Overflow is a typed overflow style.
func AllOverflows ¶
func AllOverflows() []Overflow
AllOverflows returns every Overflow in stable order.
type PointerEvents ¶
type PointerEvents string
PointerEvents is a typed pointer-events style.
const ( PointerAuto PointerEvents = "auto" PointerNone PointerEvents = "none" )
func AllPointerEvents ¶
func AllPointerEvents() []PointerEvents
AllPointerEvents returns every PointerEvents in stable order.
type Position ¶
type Position string
Position is a typed CSS position.
func AllPositions ¶
func AllPositions() []Position
AllPositions returns every Position const in stable order.
type PositionOffset ¶
type PositionOffset string
PositionOffset is a non-spacing positional fraction used to anchor overlays. It is separate from Spacing so values such as 1/2 cannot leak into padding, gap, or size utilities.
const (
PositionHalf PositionOffset = "1/2"
)
func AllPositionOffsets ¶
func AllPositionOffsets() []PositionOffset
AllPositionOffsets returns every governed overlay-position fraction.
type ResizeMode ¶
type ResizeMode string
ResizeMode is a typed textarea resize mode.
const ( ResizeModeNone ResizeMode = "none" ResizeModeY ResizeMode = "y" ResizeModeBoth ResizeMode = "both" )
type RingOffset ¶
type RingOffset string
RingOffset is a typed ring-offset thickness step.
const ( RingOffset0 RingOffset = "0" RingOffset1 RingOffset = "1" RingOffset2 RingOffset = "2" RingOffset4 RingOffset = "4" RingOffset8 RingOffset = "8" )
func AllRingOffsets ¶
func AllRingOffsets() []RingOffset
AllRingOffsets returns every RingOffset in stable order.
type RingWidth ¶
type RingWidth string
RingWidth is a typed focus-ring thickness step.
func AllRingWidths ¶
func AllRingWidths() []RingWidth
AllRingWidths returns every RingWidth in stable order.
type Spacing ¶
type Spacing string
Spacing is a typed spacing step matching tokens.SpacingScale entries. Values serialize to the Tailwind spacing key (e.g., "3.5", "4", "px"), not to a complete utility class. The ClassList builder combines a Spacing with its role (padding, margin, width, height, gap) to produce the final Tailwind class.
const ( SPX Spacing = "px" // 1px S0 Spacing = "0" // 0rem S0_5 Spacing = "0.5" // 0.125rem S1 Spacing = "1" // 0.25rem S1_5 Spacing = "1.5" // 0.375rem S2 Spacing = "2" // 0.5rem S2_5 Spacing = "2.5" // 0.625rem S3 Spacing = "3" // 0.75rem S3_5 Spacing = "3.5" // 0.875rem S4 Spacing = "4" // 1rem S5 Spacing = "5" // 1.25rem S6 Spacing = "6" // 1.5rem S7 Spacing = "7" // 1.75rem S8 Spacing = "8" // 2rem S9 Spacing = "9" // 2.25rem S10 Spacing = "10" // 2.5rem S11 Spacing = "11" // 2.75rem S12 Spacing = "12" // 3rem S14 Spacing = "14" // 3.5rem S16 Spacing = "16" // 4rem S20 Spacing = "20" // 5rem S24 Spacing = "24" // 6rem S28 Spacing = "28" // 7rem S32 Spacing = "32" // 8rem S36 Spacing = "36" // 9rem S40 Spacing = "40" // 10rem S44 Spacing = "44" // 11rem S48 Spacing = "48" // 12rem S52 Spacing = "52" // 13rem S56 Spacing = "56" // 14rem S60 Spacing = "60" // 15rem S64 Spacing = "64" // 16rem S72 Spacing = "72" // 18rem S80 Spacing = "80" // 20rem S96 Spacing = "96" // 24rem SAuto Spacing = "auto" // auto SFull Spacing = "full" // 100% (width/height only) )
Spacing steps — names align with tokens.SpacingScale and the Tailwind default spacing scale. Fractional values use underscore for the decimal point in the Go const name (S0_5 → "0.5").
func AllSpacings ¶
func AllSpacings() []Spacing
AllSpacings returns every Spacing const in stable order. Used by the typed tables and All* enumerators to validate compile-table coverage.
type State ¶
type State string
State is a typed CSS modifier state (hover, focus, disabled, etc.). Used with ClassList.On() to wrap child classes in a Tailwind prefix such as "hover:" or "focus-visible:".
const ( StateHover State = "hover" StateFocus State = "focus" StateFocusVisible State = "focus-visible" StateDisabled State = "disabled" StatePlaceholder State = "placeholder" )
The state modifiers this application uses. Eleven more were declared and nothing ever named one — a vocabulary is a list of what a component may say, and a word with no speaker is a word a reader has to look up. A component that needs first:, odd: or group-hover: adds it back in the commit that uses it, which is also the commit that makes the CSS carry the rule.
type TextAlign ¶
type TextAlign string
TextAlign is a typed text alignment.
func AllTextAligns ¶
func AllTextAligns() []TextAlign
AllTextAligns returns every TextAlign const in stable order.
type Tracking ¶
type Tracking string
Tracking is a typed letter-spacing step.
func AllTrackings ¶
func AllTrackings() []Tracking
AllTrackings returns every Tracking const in stable order.
type Transition ¶
type Transition string
Transition is a typed CSS transition property group.
const ( TransitionNone Transition = "none" TransitionAll Transition = "all" TransitionColors Transition = "colors" TransitionOpacity Transition = "opacity" TransitionShadow Transition = "shadow" TransitionTransform Transition = "transform" )
func AllTransitions ¶
func AllTransitions() []Transition
AllTransitions returns every Transition const in stable order.
type Translate ¶
type Translate string
Translate is a typed translate step (for hover lifts etc.).
const ( TranslateNone Translate = "0" TranslatePx Translate = "px" Translate0_5 Translate = "0.5" TranslateHalf Translate = "1/2" Translate1 Translate = "1" TranslateNeg05 Translate = "neg-0.5" // -translate-y-0.5 TranslateNegHalf Translate = "neg-1/2" TranslateNeg1 Translate = "neg-1" TranslateNeg2 Translate = "neg-2" )
func AllTranslates ¶
func AllTranslates() []Translate
AllTranslates returns every Translate in stable order.
type ViewportHeight ¶
type ViewportHeight string
ViewportHeight is the closed set of viewport-relative heights used by governed overlays. Keeping these values typed lets CSS emission remain fail-closed while supporting responsive drawers and sheets.
const ( VH25 ViewportHeight = "25" VH50 ViewportHeight = "50" VH75 ViewportHeight = "75" VH85 ViewportHeight = "85" VH100 ViewportHeight = "100" )
func AllViewportHeights ¶
func AllViewportHeights() []ViewportHeight
AllViewportHeights returns every supported viewport height in stable order.
type ZLayer ¶
type ZLayer int16
ZLayer is a typed semantic z-index layer. The underlying value is the numeric z-index used across the design system (see tokens.ZIndexScale). The Class() method converts a ZLayer to its Tailwind arbitrary-value class (e.g., ZModal → "z-[1400]"), so there is no "magic z-50 vs z-70" — every layer's number comes from the typed tokens.
const ( ZBelow ZLayer = -10 ZBase ZLayer = 0 ZDocked ZLayer = 10 ZDropdown ZLayer = 1000 ZSticky ZLayer = 1100 ZBanner ZLayer = 1200 ZOverlay ZLayer = 1300 ZModal ZLayer = 1400 ZPopover ZLayer = 1500 ZToast ZLayer = 1600 ZTooltip ZLayer = 1700 )
Semantic z-index layers. Numeric values match tokens.DefaultZIndex and are the single source of truth. Changing the value here is the only place a z-index number should ever appear.