Skip to content

Commit

Permalink
Only replace sizes in bitstyles utility classes
Browse files Browse the repository at this point in the history
  • Loading branch information
angelikatyborska committed Jul 8, 2024
1 parent 6b71961 commit 15d7c55
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/bitstyles_phoenix/bitstyles.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ defmodule BitstylesPhoenix.Bitstyles do
}

class =
Enum.reduce(sizes_renaming, class, fn {new_size, old_size}, acc ->
String.replace(acc, "-#{new_size}", "-#{old_size}")
end)
if String.starts_with?(class, "u-") do
Enum.reduce(sizes_renaming, class, fn {new_size, old_size}, acc ->
String.replace(acc, "-#{new_size}", "-#{old_size}")
end)
else
class
end

border_color_renaming = %{
"u-border-gray-light" => "u-border-gray-10",
Expand Down

0 comments on commit 15d7c55

Please sign in to comment.