zachdaniel / tails

Utilities for working with tailwind classes, like semantic merge, and conditional class lists.
MIT License
85 stars 9 forks source link

`border-b-*` overriden by `border-opacity-*` #13

Closed TrevorHinesley closed 10 months ago

TrevorHinesley commented 10 months ago

Describe the bug If a border-b-* class (e.g. border-b-4) precedes a border-opacity-* class (e.g. border-opacity-20), the former is removed from the list.

To Reproduce On any element:

<div class={Tails.classes(["border-black border-b-4 border-opacity-20"])}></div>

The rendered element:

<div class="border-opacity-20 border-black"></div>

Expected behavior I expect the rendered element to maintain non-competing classes, like so:

<div class="border-black border-opacity-20 border-b-4"></div>

Note: this can be fixed by doing something like:

<div class={Tails.classes(["border-black/20 border-b-4"])}></div>

But still, I suspect the current behavior is not intended.

Runtime

zachdaniel commented 10 months ago

I've added a test for this, but am unable to reproduce it in the latest main. It looks like we have made some fixes that have not been released, I'll cut a release and you can try that :)

zachdaniel commented 10 months ago

0.1.8 has been released.

TrevorHinesley commented 10 months ago

@zachdaniel thanks for shipping that release! Unfortunately, this is still occurring on 0.1.8:

<div class={Tails.classes(["border-b-4 border-opacity-20"])}

results in:

<div class="border-opacity-20"></div>

In iex:

iex(1)> Tails.classes(["border-b-4 border-opacity-20"]) 
"border-opacity-20"
iex(2)> Application.spec(:tails, :vsn)
~c"0.1.8"
zachdaniel commented 10 months ago

Hmm…could you write a test that reproduces this in the repo?

On Tue, Nov 21 2023 at 2:26 PM, Trevor Hinesley < @.*** > wrote:

@zachdaniel ( https://github.com/zachdaniel ) thanks for shipping that release! Unfortunately, this is still occurring on 0.1.8 :

<div class={Tails.classes(["border-b-4 border-opacity-20"])}

results in:

— Reply to this email directly, view it on GitHub ( https://github.com/zachdaniel/tails/issues/13#issuecomment-1821550305 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/ABLVBYZCVTX6LRPCUYXCAQDYFT553AVCNFSM6AAAAAA7TG7PJ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRRGU2TAMZQGU ). You are receiving this because you were mentioned. Message ID: <zachdaniel/tails/issues/13/1821550305 @ github. com>

TrevorHinesley commented 10 months ago

Here's the failing test, both of these refute statements fail: https://github.com/TrevorHinesley/tails/commit/dc640e89041b65e72cf9f04dff7c48d209bc847c

zachdaniel commented 10 months ago

Thanks for the test, I believe the issue should be resolved now :)

TrevorHinesley commented 10 months ago

Thanks a bunch!

TrevorHinesley commented 10 months ago

Do you want to cut a release for that?