PhoenixPaper.Spacing (PhoenixPaper v0.1.0)

Copy Markdown View Source

Named spacing tokens on top of Tailwind's default scale (which is already a 4px/0.25rem grid, compatible with Material's 8dp baseline grid).

Components should reference these tokens instead of raw Tailwind spacing numbers so a project-wide density change is a one-file edit. As with PhoenixPaper.Elevation, every class is a full literal string (never interpolated) so Tailwind's static scanner can find it in this file.

Summary

Functions

Returns the Tailwind gap class (gap-*) for a spacing token.

Returns the Tailwind padding class (p-*) for a spacing token.

Types

token()

@type token() :: :none | :xs | :sm | :md | :lg | :xl | :"2xl"

Functions

gap(atom)

@spec gap(token()) :: String.t()

Returns the Tailwind gap class (gap-*) for a spacing token.

padding(atom)

@spec padding(token()) :: String.t()

Returns the Tailwind padding class (p-*) for a spacing token.