Liveview Alert Message Styling with Tailwind CSS

I know it has been a while and maybe no longer relevant. But maybe someone else will stumble upon this post. I guess the issue here is the default styling which is still applied.

Phoenix LiveView comes with a clever CSS rule

.alert:empty {
  display: none;
}

This works quite well as long as you use their default markup. The moment you add DOM elements to the default <p> tag, it is no longer empty. Therefore, the browser wont hide it and you see an empty green tag.

I am not sure if there is a better way, but @polypush135 's solution should work.