Live data from Hacker News

You can make up HTML tags

maurycyz.com

111–120 of 202 posts

Re: You can make up HTML tags

#111
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.

Really? Flash had been such an absolute pain for me for years, I was so happy when my bank stopped using it so I could uninstall the heck out of it.

Re: You can make up HTML tags

#112
You've always been able to do it, doesn't even need to be HTML, serialise as XHTML and you can include the tags on your own namespace and have separate CSS for them.

        xmlns="http://www.w3.org/1999/xhtml"

        xmlns:ns1="mynamespace"

        xmlns:ns2="yournamespace"
>

Hello

Hello

Hello

    @namespace ns1 "mynamespace";

    @namespace ns2 "yournamespace";

    CustomElement {

        color:green;

    }

    ns1|CustomElement {

        color:red;

    }

    ns2|CustomElement {

        color:blue;

    }

Re: You can make up HTML tags

#114
post #29
post #4

By default, they will behave like spans. You can customize it using the Custom Element API: https://developer.mozilla.org/en-US/docs/Web/API/Web_compone...

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 implementers, and needing dozens of new specifications to fix glaring holes that exist only because web components exist. All of those specs? A heavy dousing of Javascript of course.

Even the people who push them heavily cannot agree on what they are good is and what the goal of them is

Re: You can make up HTML tags

#116
post #91

are NOT unrecognized tags! I blogged about this: https://dashed-html.github.io ◄ = always an HTMLUnknownElement until the WHATWG adds it as new Element. ◄ = (No JS!) UNDEFINED Custom Element , valid HTMLElement, great for layout and styling ◄ Upgraded with the JavaScript Custom Elements API it becomes a DEFINED Custom Element --- ► This is standard behaviour in all browsers. Chrome (2016) Safari (2017) FireFox (2018)…

Why is this not default practice?

Re: You can make up HTML tags

#117
The things should be as easy as possible.

The goal is to make content readable by anything. As more users access information through systems like ChatGPT instead of visiting websites directly, content that isn’t easily interpreted by AI crawlers risks becoming effectively invisible.

see: https://github.com/ai-first-guides

Re: You can make up HTML tags

#118

The things should be as easy as possible. The goal is to make content readable by anything. As more users access information through systems like ChatGPT instead of visiting websites directly, content that isn’t easily interpreted by AI crawlers risks becoming effectively invisible. see: https://github.com/ai-first-guides

Not sure about you, but I personally prefer my websites not to be able to be plagiarised by AI

Re: You can make up HTML tags

#119
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…

What makes custom elements good is inrerop. I can use them in react, Vue, angular, svelte, solid, or just plain ol' server rendered html. I can switch out the internals entirely for a WC lib, or not, with nobody knowing or caring.

This is a unique advantage to WCs. And it's such a compelling advantage that it makes almost all the downsides tolerable. At least if you are in a position where your component might be used in many places. Design Systems are a good example. The consumer can be any app, built on any technology.

And there are plenty of downsides. But they are mostly felt by the author, not the consumer. Similar to how TS libs can be very complex to author because of type level gymnastics, but when done right are easy to consume.

(I do not push them heavily, but I can appreciate strengths and weaknesses of all tools)

Re: You can make up HTML tags

#120
post #114

Earlier quoted context omitted.

> 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…

What makes custom elements good is inrerop. I can use them in react, Vue, angular, svelte, solid, or just plain ol' server rendered html. I can switch out the internals entirely for a WC lib, or not, with nobody knowing or caring. This is a unique advantage to WCs. And it's such a compelling advantage that it makes almost all the downsides tolerable. At least if you are in a position where your component might be use…

> At least if you are in a position where your component might be used in many places.

I think someone once called them leaf components, and on this I agree.

Post reply on HN