I want to hide wishlist icon in header

i have sofine theme .. i want to hide wishlist icon in header when its empty and show when item added in wishlist same we did for cart icon .. @tim_tairli your solution worked for cart icon can you please help with this one also thanks

That’s even easier because property is already updated with JS.
Just add CSS rule:

:is(.laber-wishlist, .item_wishlist):has([data-js-wishlist-count="0"]) {
  display: none !important;
}

it worked thanks… but when click on wishlist it shows me empty page while i can see item added on icon… i added page → wishlist from pages in menu

Since you have not shared a link to your store, I had to use theme demo store to base my answers on.
In that store, clicking the wishlist icon in header shows a drawer.
Not sure what happens in yours and why.

With my code added:
Empty wishlish → Item added → Icon clicked:


if my post is helpful, please like it ♡ and mark as a solution -- this will help others find it