Closed gavinmcfarland closed 5 years ago
Whoops, that's a mistake in the docs, pushing a fix now.
The solution is you need to use a template string, not a regular single quoted string:
- icon: iconColor => '<svg fill="${iconColor}" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ><path d="M0 11l2-2 5 5L18 3l2 2L7 18z"/></svg>'
+ icon: iconColor => `<svg fill="${iconColor}" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ><path d="M0 11l2-2 5 5L18 3l2 2L7 18z"/></svg>`
No worries. I did a quick test, I think it's pulling in the colour now but should it be a hex value? It's outputting the following.
fill='%232d3748'
Sorry that was my bad, I can see that for it to be a data URI it needs to be converted as you have it. It works now. Thank you.
Using the custom SVG icon example on the homepage the iconColor doesn't output correctly.
I installed a fresh install of tailwind with the
custom-forms
plugin installed and it outputs the following:In particular notice the fill is showing
fill='%24%7biconColor%7d'
Many thanks, Gavin