Skip to content
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

Question: what about allowing data-g-* attributes? #5

Open
jaxtheking opened this issue Mar 2, 2020 · 2 comments
Open

Question: what about allowing data-g-* attributes? #5

jaxtheking opened this issue Mar 2, 2020 · 2 comments

Comments

@jaxtheking
Copy link

jaxtheking commented Mar 2, 2020

Many of my clients regard W3C validation as the absolute truth and fear that any validation error always leads to some kind of SEO penalty. I've tried explaining that some errors are not as bad as others and that they should be taken as suggestions (especially when google/youtube/others do not follow them themselves). While there's no reasoning with some people, I can still see where they're coming from.

So, to the point: W3C do not consider any of the g-* custom attributes to be valid. By their standards, only data-* attributes should be used.

I'm using Gia alongside Swup and I have found a quick method to transform a data-g-* attribute into g-* before any component is loaded, without overriding Gia.

I think Angular does have the option to use either data-ng-* or ng-* attributes.
Would you consider doing the same for Gia? This could be either automated or a new global option (say attrPrefix = '' or useDataAttrs = false) could be introduced.

Thanks,
Luca

@jaxtheking jaxtheking changed the title Question: what about using data-g-* attributes? Question: what about allowing data-g-* attributes? Mar 2, 2020
@gmrchk
Copy link
Member

gmrchk commented Aug 4, 2020

Hey @jaxtheking, sorry for the delay, I'm not involved with this lib too much lately.

I definitely get your point with "stubborn" clients and using the Gia config for this should work nicely, but I don't feel like making the decision. I think @cirmaciu should decide, but I'm sure having a PR with this functionality ready would definitely make the decision easier. 🙂

@jaxtheking
Copy link
Author

Hi @gmrchk, no problem at all - thanks for coming back to me at all.
As the project is still ongoing, I'd definitely be interested into providing a PR for this.
Since lately I don't have a lot of time to spare, if @cirmaciu could kindly confirm whether he thinks this is a good idea I could find the time - knowing it's not going to be a pointless exercise.

Thanks for this tiny library btw - for a server-rendered dev like me, in its simplicity and effectiveness, this really rocks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants