Skip to content

Commit

Permalink
fix: don't sort variants
Browse files Browse the repository at this point in the history
this makes it easier to make certain kinds of mistakes, specifically
we won't know to merge things like `sm:hover:class` and `hover:sm:class`,
but there are cases with variants where order (unfortunately) matters,
and so we don't have any other option.
  • Loading branch information
zachdaniel committed Dec 5, 2023
1 parent 580935c commit ba7a7cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/custom.ex
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ defmodule Tails.Custom do
last = List.last(rest)
variants = :lists.droplast(rest)

key = Enum.sort([unquote(modifier) | variants])
key = [unquote(modifier) | variants]

if Map.has_key?(tailwind.variants, key) do
%{tailwind | variants: Map.update!(tailwind.variants, key, &merge_class(&1, last))}
Expand Down

0 comments on commit ba7a7cb

Please sign in to comment.