rsms / raster

Raster — simple CSS grid system
https://rsms.me/raster/
MIT License
810 stars 43 forks source link

Do I have to declare custom tags document.registerElement ? #6

Closed lud closed 4 years ago

lud commented 5 years ago

It seems not, but how do I know it would work on all browsers ?

Maybe the docs should have a little paragraph about it.

heyallan commented 4 years ago

Custom elements are still valid elements. No need to register them via JS if they won't feature any dynamic behaviour.

However the proposed syntax for custom elements is <prefix-tagname> as in <grid-container>, <grid-column>, <foo-bar>. Browsers accept custom elements using HTMLElement interface, or the HTMLUnknownElement interface, which is "invalid" but still works because it inherits from HTMLElement, it just won't have a semantic value, nor specific properties (similar to a <span>). Also W3 validator accepts custom elements as long as they use a dash in the name. Most importantly the browser won't crash, it will just render an inline, unstyled, element without semantic value.

Reference:

lud commented 4 years ago

Ok thank you