3578 stories
·
2 followers

Notes on Japan

1 Share

few Japanese people speak English

Read the whole story
emrox
4 hours ago
reply
Hamburg, Germany
Share this story
Delete

Most Common PIN Codes — Information is Beautiful

1 Share

Chip and PIN card, phone passcode, hotel safe – how predictable is your chosen PIN number?

3.4 million data points visualized from several data breaches.

Created by the late great Nick Berry of Data Genetics (redesigned and used with permission). He wrote a great data story around this which is also worth a read.

Published in our book, Knowledge is Beautiful.

Read the whole story
emrox
9 hours ago
reply
Hamburg, Germany
Share this story
Delete

The Most Talented Person In The World

1 Share
Read the whole story
emrox
9 hours ago
reply
Hamburg, Germany
Share this story
Delete

Snappy UI Optimization with useDeferredValue

1 Share

useDeferredValue is one of the most underrated React hooks. It allows us to dramatically improve the performance of our applications in certain contexts. I recently used it to solve a gnarly performance problem on this blog, and in this tutorial, I'll show you how! ⚡



Read the whole story
emrox
2 days ago
reply
Hamburg, Germany
Share this story
Delete

Bad Weather

2 Shares


View On WordPress

Read the whole story
emrox
2 days ago
reply
Hamburg, Germany
ameel
12 days ago
reply
Melbourne, Australia
Share this story
Delete

I’m worried about the tabbing behaviour, rather than the syntax and name of CSS masonry

1 Share

Back in 2022 I made this site: Be the browser’s mentor, not its micromanager. There’s some key principles on there which is a nice little collection of tiles.

Dark grey tiles with white text arranged in a standard grid in Arc

The trick during the talk — that I made this site for — was that the grid is actually progressively enhanced with masonry where browsers support it, but no one in the audience would have known that had I not told them. It’s the magic of progressive enhancement: everyone gets a fantastic experience, so they don’t even consider if they are getting the “best” experience. They already are because everything works for them.

Anyway, this is how it looks in Safari Technology Preview. It’s subtle, but it’s a nice enhancement.

Dark grey tiles with white text arranged in a masonry grid in Safari, with a slightly modified source order

The way the layout works is there’s a flexible layout composition, aptly named .grid:

.grid {
  display: grid;
  grid-template-columns: repeat(
    var(--grid-placement, auto-fill),
    minmax(var(--grid-min-item-size, 16rem), 1fr)
  );
  gap: var(--gutter, var(--space-s-l));
}

Using a CUBE exception, I added a masonry enhancement:

.grid[data-rows='masonry'] {
  grid-template-rows: masonry;
  align-items: start;
}

The nice thing about this exception is yes, it slaps the masonry grid-template-rows value in, but also, aligns items to the start, so they at least only size vertically to the size of the content where masonry isn’t available.

The reason I chose this pattern was because I knew there would be no tabbing issues because it’s just headings and paragraphs with one link. I created a little demo to show you the problem with tabbing in the current iteration of masonry, available in Firefox and Safari Technology preview:

See the Pen Tabbing issues with Masonry by Andy Bell (@andy-set-studio) on CodePen.

For those of you without those browsers, here’s what it looks like.

Watch the video.

The tabbing order is wild — especially in Firefox. That’s sorta expected though because masonry layouts pack items into available space to get that stonework-like effect — hence the name masonry.

This is a real problem though because with one line of CSS you can create a pretty serious accessibility issue. I dunno how it would get fixed, so maybe the best thing is for me to warn you not to use masonry if there’s focusable elements in play.

Which opinion on syntax do I have?

WebKit asked for opinions and Google answered, so here’s my opinion. I honestly don’t mind either of their approaches. I was thinking a while ago masonry feels like a flexbox kind of deal because by nature of a masonry layout, it’s flexible, which to me screams flexbox. I am not smart enough for CSS specs though, so I'll take whatever I'm given as long as it works.

Masonry is already available as a grid value though. What do sites that already use that experimental value do? Sure it’s part of a one-liner, but Google’s suggestion certainly isn’t. It’s a whole layout system in itself, which is a hell of a refactor! On the flip-side, I’m sure we’d rather have agreed standards than potentially half-baked ideas.

To be honest, I think masonry as a design pattern is pretty darn antiquated. I liked the example that Jen used in the WebKit post — using masonry to tidy up one of those mega menus — but in reality, unless you’re building Pintrest or Unsplash-like photographic UIs, you can probably do better without masonry anyway, which begs the question: are there better things for the browsers to be focusing on?

Read the whole story
emrox
2 days ago
reply
Hamburg, Germany
Share this story
Delete
Next Page of Stories