News for hackers. Stuff that matters.
Re:Pylon – Declarative layout primitives for CSS and HTML by uhryks on Tuesday June 11, 2019 @10:01AM (#20155439)
So basically you're abusing the fact that (modern) browsers treat unknown tags more or less as divs and built a small CSS framework with these names.

I understand how that it can feel familiar to Swift devs, and also realized by reading the source that the upside of using unknown tags means they don't have any base style that you'd have to override.

But really, you're breaking all HTML semantics and your markup is not accessible. It could work as a set of React/Vue/Whatever components or even Web components (probably the best way to achieve what you're trying to do), but as bare HTML it doesn't.

Re:Pylon – Declarative layout primitives for CSS and HTML by masklinn on Tuesday June 11, 2019 @10:05AM (#20155480)
> So basically you're abusing the fact that (modern) browsers treat unknown tags more or less as divs and built a small CSS framework with these names.

The spec allows custom elements[0] and pretty much requires this behaviour.

> you're breaking all HTML semantics and your markup is not accessible.

Calling the markup non-accessible is defensible[1], but it doesn't break HTML semantics in any way.

[0] https://html.spec.whatwg.org/multipage/custom-elements.html#...

[1] though it wouldn't be more accessible as a stack of divs and the custom element can be aria-tagged[2], in the browsers supporting it it's also possible to use customised elements but here there's little of interest

[2] https://html.spec.whatwg.org/multipage/custom-elements.html#...

Re:Pylon – Declarative layout primitives for CSS and HTML by matt-tingen on Tuesday June 11, 2019 @10:13AM (#20155564)
Custom element names must contain a hyphen for forwards-compatibility, and these do not.

https://html.spec.whatwg.org/multipage/custom-elements.html#...

Re:Pylon – Declarative layout primitives for CSS and HTML by playpause on Tuesday June 11, 2019 @10:11AM (#20155534)
The Custom Elements spec requires all custom elements to have a hyphenated name.
Re:Pylon – Declarative layout primitives for CSS and HTML by bluetidepro on Tuesday June 11, 2019 @10:07AM (#20155497)
Came to say the same thing. Seems odd to me, personally. Why not just make them class names, and you could probably still get an even smaller sized framework (if that was the main goal)?
Re:Pylon – Declarative layout primitives for CSS and HTML by uhryks on Tuesday June 11, 2019 @11:08AM (#20156070)
I think the idea is to also abstract away the choice of elements in favor of familiar container names. Make it only class names and you're back to a simple CSS framework like tons of others already.
Re:Pylon – Declarative layout primitives for CSS and HTML by Raphmedia on Tuesday June 11, 2019 @10:07AM (#20155503)
This could work with a build system or as a templating engine. The names and logic is sound, but as you said it makes little senses to use those tags as-is in production.