Spacing value for the padding prop on containers, buttons, and text inputs.
Maps to iced's Padding struct. Accepts a uniform number,
a {vertical, horizontal} tuple, or an explicit four-side map.
encode/1 always normalises to the full four-side map.
Summary
Types
Functions
Normalises a padding value to the canonical four-side map with string keys.
Examples
iex> Toddy.Iced.Padding.encode(8)
%{"top" => 8, "right" => 8, "bottom" => 8, "left" => 8}
iex> Toddy.Iced.Padding.encode({4, 12})
%{"top" => 4, "right" => 12, "bottom" => 4, "left" => 12}
iex> Toddy.Iced.Padding.encode(%{top: 1, right: 2, bottom: 3, left: 4})
%{"top" => 1, "right" => 2, "bottom" => 3, "left" => 4}