| ▲ | usernamed7 8 hours ago |
| FWIW you don't even need to define custom elements to use them: https://html3000.dev/ |
|
| ▲ | yoz-y 6 hours ago | parent | next [-] |
| This website violates the rule that all custom elements must have a dash in the tag name. |
| |
| ▲ | faboo 29 minutes ago | parent | next [-] | | That's only a hard requirement if you're creating a web component. Unknown elements are treated as inline elements by default, so if you're just using it for styling and using global attributes (even JS ones like onclick), you can use whatever tags you want. You only run into trouble when you start doing more advanced stuff with your non-standard elements. | |
| ▲ | rsstack 5 hours ago | parent | prev [-] | | https://html.spec.whatwg.org/multipage/custom-elements.html#... > This is used for namespacing and to ensure forward compatibility (since no elements will be added to HTML, SVG, or MathML with hyphen-containing local names going forward). So things that work today without a dash might break in the future if <badge>, for example, becomes a standard HTML element. | | |
| ▲ | yoz-y an hour ago | parent [-] | | Indeed. And since a lot of web is fire and forget, one day you might get a surprise. |
|
|
|
| ▲ | lazylester 4 hours ago | parent | prev | next [-] |
| imho the vaunted readability of custom elements has long been available with haml, with added readability by virtue of the indentation rules replacing closing tags. Not sure why it didn't really gain much traction, maybe the pre-processing is problematic when there's no server-side framework like Rails? |
| |
| ▲ | dmix 2 hours ago | parent [-] | | Either everyone uses HAML or no one does IMO. Developers like to copy/paste UI component example HTML from Tailwind/Bootstrap documentation, they like predictability/portability. They don't want a project that's half HTML and half HAML...ie, Vue/React using HTML/JSX vs 50% of Rails views in HAML, 50% old ones in HTML. Just like how using Vanilla JS is much smoother and reliable than using the latest wrapper framework. |
|
|
| ▲ | cgarvis 7 hours ago | parent | prev [-] |
| never knew you could do css selectors on custom elements! does seem like syntactical sugar over classes. I do like the current trend with tailwind: style with markup using smaller components. But maybe there is something here with so many components being just styles... |