I'm using Go and package html/template
. This is my code in mypage.tmpl
:
<div class="col-sm-1">
<i class='fas fa-square companies-color' style="color: {{.Company.Color}}"></i>
</div>
But I get errors in VSCode:
property value expected css(css-property value expected)
and
at-rule or selector expected css(css-rule selector expected)
when I try {{ }}
in style html.
*.tmpl
file should be valid CSS and is complaining that it's not valid (which it isn't, it only becomes valid CSS once the template is executed). You either need a plug-in/setting that recognises Go template files (e.g. understands{{…}}
) or turn off syntax checking for*.tmpl
files. – Broz