jorgebucaran / classcat

Build a class attribute string quickly
MIT License
906 stars 22 forks source link

Classes order causing issue #19

Closed pedroborges closed 6 years ago

pedroborges commented 6 years ago

I'm using a utility framework with Classcat and it wasn't rendering the classes for one of the checks even thought it was evaluating to true. Switching the order of the classes, or renaming the first class made it work.

cc([
    'mr-auto px-1 py-0.5 font-bold tracking-lg rounded',
    {
        'text-black bg-white': isNew(order),
-       'text-white bg-grey': isPending(order), // don't work
+       'bg-grey text-white': isPending(order), // works
// or
+       'text-green bg-grey': isPending(order), // works
        'text-white bg-grey': isAccepted(order),
        'text-red bg-white': isExpired(order),
    }
])

I'm reporting because it looks like a bug.

jorgebucaran commented 6 years ago

@pedroborges Thanks. What classcat version were you using and can you post the original code you used? What is that diff telling me?

I am trying to repro this issue here to no avail. 🤔

Mytrill commented 6 years ago

Does 'text-white bg-grey': isAccepted(order) works? it is the same order as 'text-white bg-grey': isPending(order).

jorgebucaran commented 6 years ago

@pedroborges Could this be a bug with your CSS and not in classcat?

pedroborges commented 6 years ago

Thanks for the input guys! I have reverted the order of the classes for that particular item and it's working fine today. Yesterday I must have messed it somehow 😕