Hacker News new | ask | show | jobs
by globular-toast 878 days ago
You don't have to define it, though. Browsers are supposed to just put unknown elements in the DOM and style them like any other element, using CSS.
1 comments

Is this behavior specified by the standard? Any links to the relevant section?
The custom element specification (section 4.13) deals mostly with the registration and usage details, but the general extensibility section earlier on covers the basic use case: https://html.spec.whatwg.org/multipage/infrastructure.html#e...

"User agents must treat elements and attributes that they do not understand as semantically neutral; leaving them in the DOM (for DOM processors), and styling them according to CSS (for CSS processors), but not inferring any meaning from them."

Yes. It means they are not "custom elements". They are basically divs.
Yes, they are basically divs, but with a semantic name. Which is exactly what we wanted to achieve.
It's quite literally not what we were trying to achieve.
How else would you want custom elements to work?
More like span, since the default is inline
Ah. For some reason I misremembered that the default is block.
You don't need a standard if it works in most browsers. And that's worked fine for me on nearly a dozen enterprise web apps since ~1995