3 ms·
It should have been possible to declare and use simple web-components - which use a template and a CSS class - without any Javascript.
by lenkite 1y ago
It should have been possible to declare and use simple web-components - which use a template and a CSS class - without any Javascript.
- _benton 1y agoYou can with DSD.
- JimDabell 1y agoYou can’t. At minimum you need to call customElements.define().
- throwitaway1123 1y agoYou absolutely can. It's the primary purpose of the DSD (Declarative Shadow DOM), one of the many new specifications people complain incessantly about. <my-component> <template shadowrootmode="open"> <style> ::slotted(*) { font-weight: bold; font-family: sans-serif; } </style> <slot></slot> </template> <p>content</p> </my-component>