livewire-flash icon indicating copy to clipboard operation
livewire-flash copied to clipboard

Better tailwind compatibility

Open willvincent opened this issue 2 years ago • 5 comments

Closes #23

  • I've split views out into individual views for each message type, inlining their classes so Tailwind JIT works as expected
  • I've included the auto dismiss logic, though it has a bug that limits it to only auto-dismissing one message, others will tick down and then the progress bar resets without them getting dismissed, they can still be manually dismissed by clicking the x.
  • Heroicon svgs have been added for the close button and status icons, as they're small and don't require any third party add ons.
  • config file removed, and instead made the views publishable

willvincent avatar May 19 '22 03:05 willvincent

I suspect the auto-dismiss issue is a combination of livewire weirdness and the logic to select the messageElement: var messageElement = document.getElementsByClassName('flashMessage')[0];

Though, interestingly the mouseover/mouseleave events do work, so it seems that listeners are being attached, callbacks are failing to fire though. Only the last/longest running timer's callback gets fired. 🤷‍♂️

willvincent avatar May 19 '22 03:05 willvincent

Hey @willvincent !! Sorry to take so long to get to this.

So off the cuff, I agree - this needs to happen. I think abolishing the config would actually be a great idea. Some thoughts about this PR:

  • I'd like to separate the auto-dismiss and the Tailwind refactor into separate PRs / versions. Auto-dismiss is still a WIP in my mind, and I'd like to be able to refine it a bit more before releasing it officially.
  • There's a lot of opinionated style changes mixed into this PR (probably PHP CS Fixer or something from your IDE). I probably need to decide on style for this repo, but for now I'd like to see about rolling those back and just adhering to what's here already. Some examples are reordering of methods, and space between the NOT operator (!).

Does that make sense? If we could strip the auto-dismiss out and get code style matching, I think we'd be good.

Open to thoughts/discussion. Thanks so much for the contribution!

mattlibera avatar May 27 '22 19:05 mattlibera

It would be amazing to have this I've just had to do it manually to save the clases getting stripped.

howdu avatar Sep 16 '22 16:09 howdu

@mattlibera will this be merged any time soon, or is this dead?

josefbehr avatar Jan 17 '23 13:01 josefbehr

@josefbehr @howdu Thanks for the interest. I'll admit that I haven't had the time to dig into this in-depth, but I was kind of waiting on updates / discussion on this PR since my last comments.

I will see what I can do to find time to look at this again. If either of you have a free few minutes to check this out, please feel free... any help is greatly appreciated.

mattlibera avatar Jan 18 '23 04:01 mattlibera