mixxorz / slippers

A UI component framework for Django. Built on top of Django Template Language.

Home Page:https://mitchel.me/slippers/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

allow `{% attrs %}` to render hyphenated attributes ( `aria-label`, `data-script` etc)

lolrenx opened this issue · comments

from htmx.org

htmx gives you access to AJAX, CSS Transitions, WebSockets and Server Sent Events directly in HTML, using attributes, so you can build modern user interfaces with the simplicity and power of hypertext

htmx attributes are represented in templates tags like other attributes.
potential caveat : they are defined with a hyphen hx-get , hx-target, hx-swap ...

this enhancement could also increase compatibility with alpine, hyperscript and other frameworks that make use of custom HTML attributes, and attrs that are defined with hyphens such as aria-label

Happy to contribute to implementation

Hey. Thanks for bringing this to my attention. I hadn't considered attributes with hyphens.

I've opened a PR to address the issue. Do let me know if that works for you.

#17

Thanks for your qui response. tried a couple aria-label and htmx attributes, they render fine!
this will drastically simplify my components, thanks a lot! Now I have to refactor my spaghetti code 👍

awesome, thank you !

I've released version 0.5.0a0 which makes this case "just work" without any workarounds.

pip install slippers==0.5.0a0