# `LineaUI.ClassMerge`
[🔗](https://github.com/devaction-labs/linea_ui/blob/v0.1.1/lib/linea_ui/class_merge.ex#L1)

Joins Tailwind class lists so that a later class replaces an earlier one of the same kind.

Every component builds its classes as `[base, variant, color, size, @class]` and passes the
list here, so `<.button class="rounded-full px-8">` drops the default `rounded-lg px-5`
instead of leaving both in the attribute and letting the stylesheet order decide.

A class is reduced to a key made of its variants (`dark:hover:`), its important flag and its
group (`bg-color`, `px`, `rounded-tl`). A later class removes every earlier class whose key
is the same or belongs to a group it covers (`p-4` removes `px-2` and `pt-1`). Classes that
belong to no known group are always kept, in order.

Results are cached in ETS, since the same lists are merged on every render.

# `merge`

```elixir
@spec merge(term()) :: String.t()
```

Merges a class list (strings, nested lists, `nil` and `false` allowed) into one string.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
