Change d-icon icon by css

Hi you all!

I’m styling Follow Plugin 👨, then I started considering changes over

button[aria-label="Follow"] or button[aria-label="Following"] 

Do you know if there is some way to change icon by Css, so this way, it would be possible to change from “user-plus” (to follow) to “user-check” (following)

Screen Shot 2020-11-13 at 11.56.36

Hope you guys can help me!

Best Regards,
Felipe

EDIT(SOLUTION):
Yooo! I manipulated over user object reference

{{follow-toggle icon=(if user.following 'user-check' 'user-plus') user=user}}

Thank you all!!

3 Likes

@feabila, that’s a great idea.

So great in fact, I’ve gone ahead and committed at least part of that to the repo:

https://github.com/paviliondev/discourse-follow/commit/2609657fc4e155ea1d1f6ddb74ac2600a46eeaa0

Nice one! :+1: :tada:

Actually, I’ll keep it functionally the way you propose, but I’ll simplify and rely on the existing Computed Property:

https://github.com/paviliondev/discourse-follow/commit/6bcdebb40fea0233ac4b46548ccc720bc263c08c

Please take a look if you are interested in the alternative implementation.

Cheers!

3 Likes