Closed RedPhoenixQ closed 10 months ago
Could you add support for alpine.js as well for '.':
x-on:scroll.window="showBar = (window.pageYOffset > 20) ? true : false"
Could you add support for alpine.js as well for '.':
x-on:scroll.window="showBar = (window.pageYOffset > 20) ? true : false"
I don't think this is easily done while keeping the class shorthand. Since the macro doesn't see whitespace foo.bar
is the same as foo .bar
which would be a valid attribute and then a class name via the shorthand.
The only way to do this would to somehow replace or escape the period .
in the attribute name or add an escape character that would have to be a recognized Rust token. \
cannot be used as it isn't part of Rust syntax. Something like *.
or ^.
could work but isn't very elegant.
I don't want to make a change like class shorthand can only appear immediately after the element since that would be a breaking change.
Any idea how difficult it would be to add quoted attribute supported as mentioned here
Though about it and just tried it. I seem to have it working and will be making a new PR for that change, since it is not related to the changes in this PR.
"literals"="true"
Would like to see this feature too 👍 #396 would be just as good 👍
To do this,
try_namespace_name
now looks for nested namespaces. Becausetry_name
'gets called, anotherIdent
must be consumed to prevent and early return, which means that::
would not be valid, buta:b-c:d
would be fine.This allows for more custom attributes from different frameworks, specifically htmx's
hx-on
as mentioned in https://github.com/lambda-fairy/maud/issues/194#issuecomment-1734354727.This is my first PR, I'll gladly take critique and make any changes necessary