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.
I don't think there are any doctypes supporting x-* attributes but browser will still render the page even with "invalid" attributes.
Does it cause a particular issue?
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 data-x-[directive]. Also I was thinking x- attribute should be configurable so devs can define their own selectors. Maybe something like data-alpine-config="{prefix: 'data-x'}" so with this, alpine directives will regionesed by data-x-[directive] prefix.
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.
It will be just about adding an optional data- prefix to the regexps.
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
Most helpful comment
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.
It will be just about adding an optional data- prefix to the regexps.