quarto-ext / fontawesome

Use Font Awesome icons in HTML and PDF documents.
MIT License
97 stars 11 forks source link

Add possibility to customise colours of the icons #18

Closed giabaio closed 1 year ago

giabaio commented 1 year ago

Hi there - I have made a minor tweak to the lua file, so that colours can be customised when printing the icons. Would you be interested in merging this?

cscheid commented 1 year ago

Thanks for the contribution and interest. The idea is sound. I just wonder if the right way to do it is a little more careful (if someone else wants to add another style, then we'll have repeating style tags). Are you interested in building out a proper fix for this? We'll need a contributor agreement from you as well https://quarto.org/about.html#contribute

giabaio commented 1 year ago

Thanks. I guess this makes sense - I am not sure whether I've reached the limit of my lua expertise, though --- I was simply adding very simple code to the existing one to update it for my specific needs. Understood that others may want to increase the customisation, though...

cscheid commented 1 year ago

If you have a simple color need, it's possible that you can address it without changing the extension at all, instead simply wrapping the FA invocations in a div with a custom class, and then using CSS.

mcanouil commented 1 year ago

If I may, the easiest way to add colour or whatever styling would be to use spans, e.g.,

[{{< fa chess-pawn >}}]{style="color: #b22222;"}

In addition, style should be the variable, not colour if such feature would come to this extension in my opinion.

cscheid commented 1 year ago

I generally agree, and I think @mcanouil's solution with spans is good enough that we don't need a feature like this on the extension itself.