Fantastic.
Surprised to find myself with cataracts at my age, HN is so much more readable as presented here, comparable in improvement to viewing it under dark mode.
More importantly, by providing the lead/lede, I've found a few more pieces to read that I didn't know I wanted to read just from the headline.
I like this very much. Showing the first few lines of the article is nice to see if one wants to dig deeper. I made this my new default link to HackerNews!
That's cool but it doesn't seem to have any users. And only NYT as a source (for now). And even if it had users there's no way to align them with my interests (you might get a hoard of neo-nazis upvoting all the wrong stories). This could be solved by basing it off a specific subreddit, for example.
I haven't really posted it anywhere yet, just a WIP side project for now. That said you can create your own Board and add any RSS feed, and moderate comments.
I know that the OP probably did the research, so I'm just going to ask :
Isn't this possible with only CSS? I see each article ( section ) with position absolute and heavy JS calculations. My browser brain thinks that with some combo of flex-box / flex-wrap and breakpoints you could achieve this without the need for resize handler. I guess that's not the truth So can you point the struggles not doing this with CSS?
Sure. So, there are a couple of things I wanted from the design:
1. The top few stories should be wider than the rest, if there’s room to do so. 2. The stories should be sorted more-or-less with the top ones near the beginning of the page. 3. Stories in a column should flow continuously—there shouldn’t be any gaps where multiple columns realign. (Bear in mind that stories can be any height, and there’s no way to precompute it.) There’s a few ways of doing layouts that meet some of these criteria in pure CSS: • `column-width`: Meets requirement (3), but you can’t span columns and layout is done column-by-column so the top of the page would have stories 1, 8, and 19 (or so). • flexbox: Meets (1) and (2), but leaves unsightly alignment lines as stories can’t shift upwards to fill in gaps in the previous row. • grid: Same problems as flexbox. • server-side column break computation: requires the server to know how tall each story is, which (a) won’t work with a stylesheet where nearly everything is in relative sizes that depend on browser settings and (b) would probably be tricky with responsive design. As far as I can tell, there’s no way to do a responsive “masonry” layout with items of arbitrary height in pure CSS. At the very least it was going to be tricky and frustrating to get right, and Masonry.js was already available and (after a little poking to figure out how to tell it what I wanted) did the job without any more fuss.
I remember having similar struggles with infinite-scroll product page a while back ( ~5 years ago ), with variable card height. I thought this could be done with CSS nowadays, but I guess css grid & flex-box specs don't go that far. Awesome work!
It doesn't help right now, obviously, but for future consideration you might be interested in the proposal to extend CSS Grid to have Masonry support; see https://github.com/w3c/csswg-drafts/issues/4650.
Comments (133) 66 threads
Earlier commentsMore importantly, by providing the lead/lede, I've found a few more pieces to read that I didn't know I wanted to read just from the headline.
Psst..hey buddy, you want some RSS? ;)
That said it's a cool RSS'y way of browsing NYT.
Isn't this possible with only CSS?
I see each article ( section ) with position absolute and heavy JS calculations. My browser brain thinks that with some combo of flex-box / flex-wrap and breakpoints you could achieve this without the need for resize handler. I guess that's not the truth
So can you point the struggles not doing this with CSS?
1. The top few stories should be wider than the rest, if there’s room to do so.
2. The stories should be sorted more-or-less with the top ones near the beginning of the page.
3. Stories in a column should flow continuously—there shouldn’t be any gaps where multiple columns realign. (Bear in mind that stories can be any height, and there’s no way to precompute it.)
There’s a few ways of doing layouts that meet some of these criteria in pure CSS:
• `column-width`: Meets requirement (3), but you can’t span columns and layout is done column-by-column so the top of the page would have stories 1, 8, and 19 (or so).
• flexbox: Meets (1) and (2), but leaves unsightly alignment lines as stories can’t shift upwards to fill in gaps in the previous row.
• grid: Same problems as flexbox.
• server-side column break computation: requires the server to know how tall each story is, which (a) won’t work with a stylesheet where nearly everything is in relative sizes that depend on browser settings and (b) would probably be tricky with responsive design.
As far as I can tell, there’s no way to do a responsive “masonry” layout with items of arbitrary height in pure CSS. At the very least it was going to be tricky and frustrating to get right, and Masonry.js was already available and (after a little poking to figure out how to tell it what I wanted) did the job without any more fuss.
I remember having similar struggles with infinite-scroll product page a while back ( ~5 years ago ), with variable card height. I thought this could be done with CSS nowadays, but I guess css grid & flex-box specs don't go that far.
Awesome work!
All comments shown.
Couldn't load more comments. Check your connection and try again.