Closed gossi closed 8 months ago
interesting case here. the quickest fix might be to detect the default state with the new operators i recently added and handle the tag conditionally. it's kinda gross, but logical for the templating language.
{{?property.intent=action&property.importance=supreme&property.spacing=0}}{{!property.state=disabled}}<Button>
{{!property.intent=action|property.importance=supreme|property.spacing=0|property.state=disabled}}<Button
...
{{!property.intent=action|property.importance=supreme|property.spacing=0|property.state=disabled}}>
the other alternative would be to use single line syntax for the whole definition, especially if its rare for all four of your props to render at once.
<Button\
{{!property.intent=action}}@intent="{{property.intent}}"\
{{!property.importance=supreme}}@importance="{{property.importance}}"\
{{!property.spacing=0}}@spacing="{{property.spacing}}"\
{{property.state=disabled}}@disabled={{true}}\
\>
{{property.text}}
</Button>
closing for now, open to other ideas for ways to solve this.
I do have this code editor snippet defined:
but if none of the properties are given (ie. the default), then this is the rendered snippet for devs to copy:
which sorta looks weird.
Probably when a couple of lines beginning with qualifiers and they all turn empty, then this is trimmable?