autotune icon indicating copy to clipboard operation
autotune copied to clipboard

use <auto-tune> instead of <autotune>

Open Kilian opened this issue 6 years ago • 6 comments

Sorry for a pretty bike-shedding ticket, but a small improvement would be to use <auto-tune> instead of <autotune>. The latter is an unknown html element and thus invalid, but the former is a custom element, so compliant :)

Kilian avatar Aug 16 '18 08:08 Kilian

Interesting! Would you mind making a PR?

dvdsgl avatar Aug 16 '18 14:08 dvdsgl

Maybe autotune-experiments>? I don't want to hyphenate "autotune."

dvdsgl avatar Aug 16 '18 14:08 dvdsgl

PR is no problem! autotune-experiments is pretty long though? A somewhat default for custom elements is to prepend them with x- to work around this, that would make it <x-autotune> (e.g. https://x-tag.github.io/) or maybe <autotune-block>? Your call ;)

Kilian avatar Aug 16 '18 15:08 Kilian

Additionally, maybe prefix the autotune attributes (autotune and autotune-class) with data- to make them custom attributes.

Edit: You already do! Then just lead with that in the README.

Kilian avatar Aug 16 '18 15:08 Kilian

What is the consequence of using invalid tags? I don't like that we're doing it but it's so easy to read!

x-autotune looks great.

dvdsgl avatar Aug 16 '18 16:08 dvdsgl

No real consequences. Validators and strict parsers will complain, browsers will happily accept unknown elements. Same for attributes.

But, with custom element you could add more behaviour directly to the element using the custom elements api, potentially offloading a bunch of your code to browser native stuff. With custom attributes, you can use browser api's like dataset to make your live as a developer easier.

one PR for x-autotune coming up :)

Kilian avatar Aug 16 '18 19:08 Kilian