Hacker News new | ask | show | jobs
by thieu96 1646 days ago
I'd advice against it, unless you want to write every component by hand.

Any third party library or component you use will be affected by "classless". There's a good reason explicitly define classes.

It's the same reason you don't change native prototypes in Javascript. Libraries assume the defaults, both for styling and code.

2 comments

That's a good point. I'm by no means a HTML/CSS/JS guru but this seems the wrong way around to me. Maybe components that honour the "base" tags e.g. <p>, <h1> etc that the classless stylesheet has defined could be developed (please accept my lack of awareness of those that already do exist).

So instead of a component assuming, it needs to be pointed to the tag you, as developer/designer, require - perhaps via a config parameter. Interesting comment about using SASS to namespace, but then the elegant simplicity of these stylesheets starts to get chipped away IMHO.

I think the issue there is that there are thousands of available CSS properties. Without assumptions, every single one would have to be specified for every single class. Imagine the same for JS or any other language, you would have to re-write the standard lib if you couldn't rely on it.
It's okay, really.

I only have a handful of HTML pages with a bit text and code. Nothing fancy.

My main goal is to keep all code in the HTML files with as little boilerplate as possible.