Live data from Hacker News

You can make up HTML tags

maurycyz.com

151–160 of 202 posts

Re: You can make up HTML tags

#151

Custom tags for readability is one of those ideas which sound good in theory but stupid in practice. Think ` `, get a Slack thread where three seniors debate whether it's ` ` or ` ` while the shipper quietly ships it with ` `.

I'd ship it with in my own apps ("my own apps" in bold)

Re: You can make up HTML tags

#152

I've been doing this for about three or four years. Clever idea, tricky in practice. I don't think I'd recommend this approach broadly. But it works for me. It's definitely possible to take it too far. When most tags in your HTML are custom elements, it creates new readability problems. You can't immediately guess what's inline, what's block, etc. And it's just a lot of overhead for new people to learn. I've arrived…

That reminds me of BEM, where slow= is like the "element" within a parent "block".

Re: You can make up HTML tags

#153
post #82
post #30

Many years ago, I decided to reinvent the `blink` tag, because the monsters who make browsers removed support for it. I didn't know you could just make up tags, but I figured I'd give it a shot, and with a bit of jquery glue and playing with visibility settings, I was able to fix browsers and bring back the glorious blinking. I was surprised you could just do that; I would have assumed that the types of tags are fina…

Talking about this, I am still sad Flash got removed from the web. Nothing to replace it with to afaik.

I stand by that Flash was the most fun way to write software, especially games.

It was so satisfying being able to animate something, and immediately have the ability to create code out if it.

I have not found a platform to replace that, though GameMaker gives something of a facsimile.

Re: You can make up HTML tags

#154
post #114
post #29

Earlier quoted context omitted.

I used custom elements extensively in 2014 when support was not as widespread. I think it's a beautiful, elegant solution and I'm still a little bit bitter that React became as big as it was. Now everything "has" to be a SPA because developers want to use React, whereas most users would actually be better served with good 'ol HTML with some custom elements where needed.

> I think it's a beautiful, elegant solution Very confused by statements like these. They are extremely verbose. They are too high level, preventing many low-level optimizations. They are too low-level, preventing you from using/implementing them without going into the details of how they actually work. They break many platform assumptions and conventions, creating no end of problems both for end users and implemente…

As far as I can tell, the whole web components umbrella came into being because React/Vue got really popular, and the spec/browser people said hey let's bring the core common denominator of those into native HTML/JS, as if it would bring us closer to having native Vue/React. Which of course never happened, partly because HTML is fundamentally incapable of having anything but string attribute values, and partly because reactive DOM is basically a hard problem that can't or maybe shouldn't be solved natively.

Re: You can make up HTML tags

#155
It's one of my favorite little tricks. I use it when I'm building applications that have a lot of nested "contexts" and its not just styling/layout. Makes it easier to search for and jump to these contexts and mentally parse them. But I use it sparingly. It gets out of hand fast if you start doing .

Re: You can make up HTML tags

#156
post #82
post #30

Many years ago, I decided to reinvent the `blink` tag, because the monsters who make browsers removed support for it. I didn't know you could just make up tags, but I figured I'd give it a shot, and with a bit of jquery glue and playing with visibility settings, I was able to fix browsers and bring back the glorious blinking. I was surprised you could just do that; I would have assumed that the types of tags are fina…

Talking about this, I am still sad Flash got removed from the web. Nothing to replace it with to afaik.

Well technically you can still use Flash via Ruffle, a WebAssembly-based emulator:

https://ruffle.rs/

Sites like Kongregate amd albinoblacksheep are using it to revive their old catalog.

Re: You can make up HTML tags

#157
post #46

This is how you can set default styles for all your custom elements: :where(:not(:defined)) { display: block; }

Amazing, I was literally just trying to see if I could figure out how to do this. Thanks!

Re: You can make up HTML tags

#158
post #101

I used this to implement , the opposite of , to be able to designate sections of a page to be hidden if JS was disabled. You can of course do the same thing with classes, but custom tags are fun. https://github.com/aaviator42/yes-script

By the way, you can also do this pure CSS using the scripting media feature: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/A...

I didn't know this existed. Thanks for sharing! Very useful api

Re: You can make up HTML tags

#159

I've been doing this for about three or four years. Clever idea, tricky in practice. I don't think I'd recommend this approach broadly. But it works for me. It's definitely possible to take it too far. When most tags in your HTML are custom elements, it creates new readability problems. You can't immediately guess what's inline, what's block, etc. And it's just a lot of overhead for new people to learn. I've arrived…

I'm highly interested in approaches that utilize web grain in a balanced practical way. Do you have a framework/toolbelt or example sites to share? Would love to see. If you're interested in my approach to custom elements I created: https://github.com/crisdosaygo/good.html It utlizes custom elements, has autohooks for granular DOM updates, uses native JS template literal syntax for interpolation, imposes ordered comp…

Why is this being downvoted? I'm baffled. The comment is coherent and relevant to the discussion at hand.

Re: You can make up HTML tags

#160
post #82

Earlier quoted context omitted.

Talking about this, I am still sad Flash got removed from the web. Nothing to replace it with to afaik.

I stand by that Flash was the most fun way to write software, especially games. It was so satisfying being able to animate something, and immediately have the ability to create code out if it. I have not found a platform to replace that, though GameMaker gives something of a facsimile.

Just keep using Flash? It's called Animate now. https://www.adobe.com/products/animate.html
Post reply on HN