tv-toast icon indicating copy to clipboard operation
tv-toast copied to clipboard

Custom icon

Open borisdayma opened this issue 4 years ago • 8 comments

It would be great to be able to customize the notification icon.

borisdayma avatar Oct 27 '20 00:10 borisdayma

The difficult thing here is that it's programmatic, so slots and ways to pass this in is not really possible since there's no template to add to.

Suggestions?

acidjazz avatar Oct 27 '20 02:10 acidjazz

I'm not completely sure I understand the issue. Could we replace the "IconCheck" tag with a custom html element if defined?

borisdayma avatar Oct 27 '20 05:10 borisdayma

If I could change the icon colors, that would be great. I'm making a dark themed website, and the white icons on a dark background don't look great. Is there a built in dark theme? If not, it would be great to be able to customize the color a bit.

tandpfun avatar Mar 10 '21 00:03 tandpfun

Why can't you just provide a component with a slot just like https://github.com/sansil/vt-notifications ?

appinteractive avatar Mar 25 '21 10:03 appinteractive

@appinteractive hmm, how would that work w/ the programmatic initiation? i'm not sure how we could look for that slot definition

acidjazz avatar Mar 25 '21 23:03 acidjazz

@tandpfun I could potentially add classIconPrimary and classIconSecondary to the overrides, can you open a separate issue for this?

acidjazz avatar Mar 25 '21 23:03 acidjazz

#20

tandpfun avatar Mar 26 '21 01:03 tandpfun

I find the approach with only passing of classes okay for non tailwind projects. But for tailwind it's a must have in my opinion.

I did wrote it myself now in 1h using a store and a renderless component that uses the scoped slots (like the other repo) and a transition group. There way I do not need dozens of props but just provide my notification component with its logic and icons so I'm totally flexible and have a very simple solution.

Take a look at the me mentioned repo as that approach is solved there very elegantly. You just need a renderless component in your Layout which exposes the current array of notifications over which you can iterate. That component could set a flag to to not render it elsewhere like currently when you are using it.

Hope that helps a bit.

appinteractive avatar Mar 26 '21 13:03 appinteractive