Class names in n:class starting with a hyphen are compiled incorrectly
Closed this issue · 1 comments
zraly commented
Version: 3.0.18
Bug Description
n:class="$foo ? 'font-bold', -top-0.5"
is incorrectly compiled to [$foo ? 'font-bold' : null, -'top-0.5']
.
The problem is if the class name starts with a hyphen.
The error it produces is Unsupported operand types: string * int
Expected behavior
n:class="$foo ? 'font-bold', -top-0.5"
is compiled to [$foo ? 'font-bold' : null, '-top-0.5']
dg commented
You have to put such identifiers in quotes
https://latte.nette.org/en/syntax#toc-strings-without-quotation-marks