Hacker News new | ask | show | jobs
by rsoto 2204 days ago
This feels weird. Classes exist for a reason. When I read the title, I thought about a kind of CSS reset, but what I'm seeing is also a template/grid framework?

The weird part is that by wrapping an article within a section now I'm designing with columns (which btw, it seems there's no way to control them). And section > article turns out to be the suggested semantics for a blog.

It's a nice effort, but what I'd look for in a starter file might not be a uncontrollable grid.

2 comments

Seems like it would be awesome if HTML allowed you to set a default element

    <meta default-element="div">
and then use

    <.card>
as a shorthand for

    <div class="card">
You could be "classless" to the extent of being semantic and succinct but without having to misappropriate elements.
The yesod web framework's hamlet templates have this, albeit without the default as far as I know. <section .card> compiles to <section class="card">. If you omit the element, it uses div by default so you can use just <.card> if you prefer.
If you want to do this, look into autonomous custom elements, you can make something like `<x-card>` …no class name required!
A workaround might be little more than running a sed command on the html sources before bundling.
why not just write <div class="card">
<s>Not nearly as cool as <.card>, sorry</s>
Or use a template engine. Slim for example allows you to write just .card
Yeah, if there were a way to have this without the grid stuff, I'd be all for it. But as it is, if I want to use this I'm stuck either ignoring tags (which I may want to use) to avoid the grid stuff, or I'm stuck using a grid system which isn't very controllable.

It's cool, but I'll stick to just writing my own, light-on-classes CSS.