Live data from Hacker News

58 bytes of CSS to look great nearly everywhere

gist.github.com

41–50 of 254 posts

Re: 58 bytes of CSS to look great nearly everywhere

#41
post #9

What is wrong with browser default styling, and why do browsers ship with something that is wrong?

Default styling looks terrible and is hard to read. Humans are good at reading columns at around roughly 80 characters, while browsers default to filling the whole width of the screen with text, resulting in a column that's hundreds of characters wide. Text also gets easier to read when more spaced out; the default line height makes the text too close together. Browsers still ship the bad defaults because changing de…

I much prefer the default styling other than that the margins are nearly nonexistent. Any time I come across a site that uses mostly default styling (such as some academic webpages from the 90s), I always think to myself "wow, this is pleasant to read."

> Text also gets easier to read when more spaced out; the default line height makes the text too close together.

The opposite is easily true in my experience. Making text large, using ample line height, and even greater spacing between paragraphs, makes for text that is more readable but makes the experience of reading much worse. This is of course entirely subjective unless someone comes up with measurable evidence, like a study on the sentiment of users.

Something tells me that designers have been taking principles that are appropriate to hero page sections, advertisements, magazine covers and such, and applying them inappropriately to bodies of prose. Larger text with spacing and huge margins (or smaller max width) helps the reading impaired, but I don't really buy that people actually prefer it.

Re: 58 bytes of CSS to look great nearly everywhere

#43

What is wrong with browser default styling, and why do browsers ship with something that is wrong?

Historical reasons. Default browser styling still carry a lot of heritage from back when screens were 640x480 and you had to squeeze as many lines as possible onto the 14" screen. Of course, if you change the default CSS now that 30 years of HTML have been written to rely on these defaults, almost every website will break.

I doubt this. Almost every website overrides all of the relevant CSS attributes, because the default is just atrocious. Changing the default won't impact them.

Anyway, the browsers still can update the CSS and add a "reverse read mode" button that changes it back.

Re: 58 bytes of CSS to look great nearly everywhere

#44

Earlier quoted context omitted.

Web browsers have a hard constraint of backwards compatibility. Eventually we could see some CSS directive which enables "modern" default styling, both for mobile and desktop, but it would be opt-in so that existing sites which rely on defaults do not break.

I bet if they did an experiment where they changed the default styles a bit very very few would complain. Most people visiting tiktok or whatever wouldn't even notice.

Think for a moment. This has nothing to do with tiktok. This has to do with your favorite personal website which hasn't been updated since 2001.

And any change in default styling would be immediately noticed. Pages suddenly centered, or half the width? Increased padding?

And "most people wouldn't notice" is a harmful mentality in web design which allows minorities to suffer. Most people aren't blind, either. Should we not worry about them when designing websites?

Re: 58 bytes of CSS to look great nearly everywhere

#46

Do you still have to explicitly add CSS to do something appropriate for the user's dark mode setting? I'd rather not specify any colors at all and just let the browser use system defaults, but last time I checked, that used black-on-white even in dark mode.

Yes. Sadly, iOS Safari defaults to dark blue links on a dark background for dark mode.

Re: 58 bytes of CSS to look great nearly everywhere

#48

Earlier quoted context omitted.

Historical reasons. Default browser styling still carry a lot of heritage from back when screens were 640x480 and you had to squeeze as many lines as possible onto the 14" screen. Of course, if you change the default CSS now that 30 years of HTML have been written to rely on these defaults, almost every website will break.

I doubt this. Almost every website overrides all of the relevant CSS attributes, because the default is just atrocious. Changing the default won't impact them. Anyway, the browsers still can update the CSS and add a "reverse read mode" button that changes it back.

They override the CSS attributes that don't fit what they are doing now, but changing the defaults would introduce new attributes, which may not presently be overridden.

Re: 58 bytes of CSS to look great nearly everywhere

#49

What is wrong with browser default styling, and why do browsers ship with something that is wrong?

Historical reasons. Default browser styling still carry a lot of heritage from back when screens were 640x480 and you had to squeeze as many lines as possible onto the 14" screen. Of course, if you change the default CSS now that 30 years of HTML have been written to rely on these defaults, almost every website will break.

That's true, but there could theoretically be more then one default. I'm not arguing in favour of it, just pointing out the possibility. it would be pretty simple to create a so that it's opt-in.

I personally just don't see the point. There are a lot of bare bone frameworks around and if you're doing a static website (which would likely be the only type to benefit from that)... The <10 kilobytes gzipped css won't matter for the most part.

Re: 58 bytes of CSS to look great nearly everywhere

#50
post #21

Shot in the semi-dark: there was a blog post posted here —- I haven’t been able to find it with HN search —- some years ago that started from scartch/browser-defaults and proceeded in like 5 steps to some nice minimal defaults. Not exactly a plain reset; there were some opinionated choices. Step one was something like the parent article. Anyone have an idea what this was, or have some similar recommendations?

I had to through my saved favorites, but I knew what you were talking about. From 5(!) years ago: https://jgthms.com/web-design-in-4-minutes/

Instantly thought of the same ressource. Still something I recommend regularly to people.
Post reply on HN