Specifically when only a substring in an attribute’s value if dynamic. Here’s a concrete example. I’m translating some templates from .leex to .heex. I’m interested in ideas for translating this:
That is, using a list instead of string interpolation. This is however neither more concise nor better than @axelson’s solution, it’s just different. It may appeal to you if you prefer to use a list for your classes.
A more elegant way would be if LV allowed things like this:
Like some front-end frameworks (e.g. Vuejs) already do. I was told that Surface supports this notation, though I haven’t tested it. I’m sure that LiveView will catch up at some point