PhoenixPaper.Shape (PhoenixPaper v0.1.0)

Copy Markdown View Source

Material's corner-radius scale as Tailwind classes, so components share one consistent set of tokens instead of hand-picking rounded-* per component. As with PhoenixPaper.Elevation/PhoenixPaper.Spacing, 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 class rounding all four corners to token.

Returns the Tailwind class rounding only the edge (:top or :bottom) corners to token — used by components like the filled text field, whose Material spec only rounds the top corners.

Types

edge()

@type edge() :: :all | :top | :bottom

token()

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

Functions

class(token)

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

Returns the Tailwind class rounding all four corners to token.

iex> PhoenixPaper.Shape.class(:lg)
"rounded-lg"

class(atom1, atom2)

@spec class(token(), edge()) :: String.t()

Returns the Tailwind class rounding only the edge (:top or :bottom) corners to token — used by components like the filled text field, whose Material spec only rounds the top corners.

iex> PhoenixPaper.Shape.class(:lg, :top)
"rounded-t-lg"