Closed mikeysouthwell closed 5 months ago
See Single Line Syntax as well as my feedback on #7. Essentially, this templating language treats every line as a "yes" or "no" when it comes time to render, so you want to split each property up onto its own line.
I think your code got treated like HTML so I cant see all of it, but something like:
<Border\
Stroke="{{css.border}}"\
x:Name="{{node.name|pascal}}"\
\>
Will end up rendering on a single line like <Border Stroke="..." x:Name="...">
or <Border Stroke="...">
if name was undefined.
Also, I see you've been putting conditionals on every line that refers to a value. If the value is undefined, the line won't render, so the conditional in those cases will be redundant. Just a time saver!
{{?css.border}}Stroke="{{css.border}}"
and Stroke="{{css.border}}"
are virtually the same template!
{{?node.type=frame}}<Border {{?css.border}}Stroke="{{css.border}}"> {{?node.name}}x:Name="{{node.name|pascal}}"
Expected output:
Node has a border (currently this isn't possible because you can't grab Stroke or StrokeThickness from css, it returns all properties):