Hacker News new | ask | show | jobs
by thdrdt 2346 days ago
I like a data-first approach when designing websites. Or another way to think of it: how HTML was intended.

You write HTML and later use CSS to give that data a nice look.

Let's say you want to create a blog. Then you might have the following HTML tags in your page: H1, H2, TIME, P, A, IMG

That's it.

Then style those element and you are done.

Now ofcourse the above is an extreme simplification.

But with frameworks like Bootstrap you take the complete opposite approach. You fill your HTML with loads and loads of DIVs just to make something look good. Imho this is a mistake.

It also makes people to add data they don't need because 'every bootstrap page has a hero'.

As for a minimalistic design: just use 1 or 2 margins/paddings and around 3 to 4 colors everywhere.

3 comments

Although I mainly agree with you — I pretty much take exactly that minimalist approach with my own site — I think you're being a bit unfair on Bootstrap. Using just your example tags in conjunction with Bootstrap is perfectly acceptable, and it would only really take a single DIV (container) to wrap the content. Bootstrap gets more complicated when it comes to layout, navigation, and additional content, though, but this also becomes an issue in plain HTML anyway.

I would, though, like a really good 'minimalist' framework that just works — almost as a reset — with no classes at all. '<table class="table">' has always bugged me in Bootstrap, and there are other examples with certainly feel overengineered, that lead to spaghetti HTML.

The difficulty here is that the word "div" is still highly overloaded in CSS. That said, I can probably put something together which satisfies what you're asking for - a set of "sensible defaults", like halfway between normalize.css and bulma. It might be an interesting design challenge!
> You write HTML and later use CSS to give that data a nice look.

That's how I did it a few days ago, after a stint with DokuWiki: https://www.2uo.de/myths-about-urandom/

It is kind of "ugly" and I still need to tinker with some things, but it also feels liberating.

It looks pleasant to me. Nothing ugly about it.
Milligram [1] and Scaffold (recently on HN [2]) follow this principle of doing a stylesheet for semantic, classless HTML.

[1] https://milligram.io/

[2] https://news.ycombinator.com/item?id=21948472