-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discuss - valid HTML #433
Comments
I don't think there are any doctypes supporting x-* attributes but browser will still render the page even with "invalid" attributes. |
I used to challenge this a lot back in time. I was building front end of airline company's website which they need to be valid by W3C and WCAG guidelines and validators. So i couldn't use custom attributes or anything that cause red flag on the validation. This wonders me if that is the case, could we go with |
I think we can easily support an extended syntax data-x-* along the canonical one for those who need to stick with valid html5 syntax if Caleb is cool with that. |
I agree with adding support for "data-x-" on top of "x-" (rather than config). In a way I'm sure it could just be a "alpine-w3c-compliant" fork since the changes are likely to be very localised |
I think we should hold off on this until it's a legitimate problem for people. Not worth the work of no one actually needs it |
I think it would be good to have an alternative. I was thinking of using alpine together with server rendered react, but jsx doesn't support non-valid attributes like |
Oh, seems it's already there using |
Any news on this item? I can't upload my premium theme on Envato platform because of this issue :( |
@vrabote V3 supports custom prefixes: #2042 (comment) |
@SimoTod Thank you!!! It's will be nice to have that in docs 👍 |
@vrabota - good call. Can you PR documentation for it? Thanks! |
@calebporzio I implemented a solution proposed by @SimoTod , but it does only partially work and doesn't pass validation. This is my entire alpine setup:
Unfortunately, this also prevents me from releasing this product on ThemeForest. Using data-x-* attributes, I don't have the invalid attributes errors of before. But now I have XML errors. So Iam affraid this isn't solved yet or Iam missing something. See attached screen. |
@driss-chelouati you can't use custom data-* attributes with |
@driss-chelouati you can fix your issues by using this approach https://alpinejs.dev/globals/alpine-data#encapsulating-directives-with-x-bind Instead of defining your custom directives like |
@vrabota That would only result in unecessary convolutions in my code as it does not fit my use case. I simply need to use existing directives or otherwise why are they still there if they do not validate? In the end, I'll just end up converting my stuff to Vue and dropping alpine for good as I don't see a fix coming for this in a reasonable delay. |
That's not a viable solution, it completely change most developper workflow whereas we just need a syntax that would be w3c valid. |
@PubliAlex This is probably your best shot: #3397 |
Hi This is more of a discussion of good form.
Html validation throws errors on a lot of the Alpine markup. [ x-data , @click, :class etc ] . I'm using the following Doctype declarations.
<!DOCTYPE html> <html lang="en"> <meta charset="UTF-8">
Is there an advisory on a better doctype declaration to allow these attributes?
There is no fuctional error just a validation error.
The text was updated successfully, but these errors were encountered: