Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I thought about this when I was writing my comment, my mind wandered down the track of:

'hey, maybe you could create a web component <card>? That would be cool. It's a shame you can't create web components without JS, wouldn't it be great just to have an HTML only syntax for creating a web component, like <template tagname="card"> or something?'

Then I realised that I still have to learn something else to write a 'card', so I might as well just keep it simple and use div.card. If I want anything more complex, I can use one of the many component frameworks that exist.



No need for JavaScript unless you want your element to have additional behaviour attached to it. <mvc-card></mvc-card> would be perfectly valid with no JavaScript required. But yeah, there’s not generally particular value in doing it that way rather than a div or span with a class attribute.


Interesting, thanks, did not know that would be valid!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: