Skip to content

Commit

Permalink
fix: fix spacing for naked rounded class (#22)
Browse files Browse the repository at this point in the history
* Add breaking doctest to show missing space

When a naked (no-suffix) form of rounded class is used along with another class that would precede it, no space is given between rounded and the class preceding it.

* Add space before naked rounded class

Makes the doctest in the prior commit pass by adding a space in front of rounded, which is a Directional{all: “”}, naked class.
  • Loading branch information
marcpeabody authored Apr 20, 2024
1 parent a1cc055 commit d09f753
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/custom.ex
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,8 @@ defmodule Tails.Custom do
"rounded"
iex> merge("rounded", "rounded-lg") |> to_string()
"rounded-lg"
iex> merge("rounded", "px-2") |> to_string()
"px-2 rounded"
iex> merge("border-separate", "border-spacing-1") |> to_string()
"border-spacing-1 border-separate"
iex> merge("shadow", "shadow-md") |> to_string()
Expand Down Expand Up @@ -1486,7 +1488,7 @@ defmodule Tails.Custom do
defp direction(nil, _, _, _, _), do: ""

defp direction("", suffix, prefix, nil, dash_suffix?),
do: [prefix, dash_suffix(suffix, dash_suffix?)]
do: [" ", prefix, dash_suffix(suffix, dash_suffix?)]

defp direction("-" <> value, suffix, prefix, nil, dash_suffix?),
do: [" -", prefix, dash_suffix(suffix, dash_suffix?), "-", value]
Expand Down

0 comments on commit d09f753

Please sign in to comment.