Live data from Hacker News

58 bytes of CSS to look great nearly everywhere

gist.github.com

111–120 of 254 posts

Re: 58 bytes of CSS to look great nearly everywhere

#111

Also restated here: https://www.swyx.io/css-100-bytes

Does anyone know what theme that blog is using? It looks really nice.

uh wow, this is the first time anyone's complimented anything I designed lol!

it's a handrolled theme, with a lot of inspo from @leerob of vercel. i keep a clonable version here https://github.com/sw-yx/swyxkit/

Re: 58 bytes of CSS to look great nearly everywhere

#112
post #99
post #83

Earlier quoted context omitted.

I almost agree, but there’s a difference between number of characters and width, and also graphics and tables are a different beast. Personally, I think websites should fill up the available space, increasing font size if it makes sense, perhaps using resizing images. So, no - text should not be constrained to a maximum width. If width were a problem, billboards wouldn’t be a thing.

Have you ever seen a long text on a billboard? I guess not.

I'm pretty sure you misunderstood what I wrote.

> there’s a difference between number of characters and width

Billboards use large letters to fill the space, but normally they would be readable on a business card.

Re: 58 bytes of CSS to look great nearly everywhere

#114
post #103

Is there a html/css only way to automatically “columnize” text into multiple columns of reasonable width?

There is the columns CSS property: https://developer.mozilla.org/docs/Web/CSS/columns

You probably don't want to apply it to a whole document because then you need to scroll back to the top to read the second half. But it can be effective to columnize text sections between headings.

Re: 58 bytes of CSS to look great nearly everywhere

#115

It seems like I'm permanently in some sort of dystopian nightmare 'unpopular opinion' group where wasting two thirds of my monitors useful space is the right way about doing things. I have monitors either side of my primary in portrait mode specifically for looking at a bunch of code/text and it still wastes at least half of the useful display area. https://i.imgur.com/Qk7fM35.png If I wanted this, I'd press the read…

I limit the width on my website because I find moving my eyes constantly from left to right annoying. For me it's harder to find the beginning of the next line if lines are very long.

Besides, the other half of my monitor is usually taken up by another window or two.

Re: 58 bytes of CSS to look great nearly everywhere

#116
post #112
post #99

Earlier quoted context omitted.

Have you ever seen a long text on a billboard? I guess not.

I'm pretty sure you misunderstood what I wrote. > there’s a difference between number of characters and width Billboards use large letters to fill the space, but normally they would be readable on a business card.

Fair enough. But your point requires discussing nonetheless.

You seem to suggest that fontsize should adapt to width to fill the space (seemingly to a billboard, as per your example).

If the billboard technique was used on the web, I guess we might not have more than a handful of lines on screen (on a 16:10 or so). That would disable skimming on long texts and even more, barely display a single paragraph (that's a gut guessing).

Plus, and more importantly, the distance to the screen is such that a font too big is not more readable. There's a tradeoff to he found for the fontsize that not only has to take into account the size of the screen but also the distance of the reader from the medium.

Or so I assume.

Re: 58 bytes of CSS to look great nearly everywhere

#117

It seems like I'm permanently in some sort of dystopian nightmare 'unpopular opinion' group where wasting two thirds of my monitors useful space is the right way about doing things. I have monitors either side of my primary in portrait mode specifically for looking at a bunch of code/text and it still wastes at least half of the useful display area. https://i.imgur.com/Qk7fM35.png If I wanted this, I'd press the read…

yep. I hate it. I've seen people say this is a result of studies but I've never been able to find the studies that claim this is better. It seems to have been stated in elements of typographic style and taken as truth http://webtypography.net/2.1.2

Well you must have not searched very hard if you didn't find studies, because it took me a grand total of 3 minutes: https://www.semanticscholar.org/paper/Optimal-Line-Length-in...

There are many citations that lead to other studies on the same topic.

Re: 58 bytes of CSS to look great nearly everywhere

#118
post #88

Love things like this. This is why I can't stop reading HN. I disagree about the font-size. I say go very small (pack more info on a screen). Very easy for people to make it bigger. People have known this for hundreds of years (old newspapers pack in the text, older readers can wear spectacles or use magnifying glass).

I tend to agree but modern designers are doing the opposite and post the least amount of content in a specified amount of space. I bet that they will come to their senses eventually.

Re: 58 bytes of CSS to look great nearly everywhere

#119

Earlier quoted context omitted.

In theory sites could optimize for wide screens by adding columns, but 1) its a very small audience 2) most content is not suitable for that (how would you scroll a feed that spans 3 columns?)

https://www.nasm.us/xdoc/2.15.05/html/nasmdoc2.html The NASM website is an example of this. Personally, I don't like it and would prefer a single column.

That has a small number of long columns down the entire page, which doesn't give any of the benefits of having columns. Actually, it's only worse in terms of readability, as a big factor is how well your brain can spatialize the location of what you're reading for backwards jumps or subconscious memory palace stuff. Here that's complicated by the mental overhead of "I'm halfway down the page, but the page is really twice as long as it is, so that's actually 1/4 of the way through."

Proper column layout involves limiting columns to screen height, probably by paginating. Then the reader can perceive the text as a tree of Page > Column > Paragraph > Row. Tangentially, I think there are studies positing that this, helped by the notion of physical pages in space, is what's behind the readability advantage of books.

Alternative to pagination is scroll-direction: horizontal. Now the experience is even closer to reading a book. And to Windows 8! IMO there's a shortage of novelty sites with true (non-slideshow or carousel) horizontal scrolling.

Re: 58 bytes of CSS to look great nearly everywhere

#120

Not explicitly mentioned here, but worth bringing up: Text width should always be constrained to a maximum width to optimize for human reading. Every book ever printed has text with set within the same range for a reason. Full width text guarantees most users will have a poor reading experience.

Large margins are also distracting and a waste of human time. I wish browsers or sites would automatically flow the text into n columns depending on the view window size. It's not trivial but if one is optimizing for reading, then extra window scrolling to get to newer sections of text is not particularly optimal either.
Post reply on HN