MoreRSS

site iconAdam ArgyleModify

Web design & development tips & tricks: CSS, JS, HTML, Design, & UX
Please copy the RSS to your reader, or quickly subscribe to:

Inoreader Feedly Follow Feedbin Local Reader

Rss preview of Blog of Adam Argyle

WWW Ep250 With Christina Martinez

2026-08-04 04:55:45

Whiskey web and whatnot episode 250

Ep #250
Live at React Miami with Christina Martinez

Robbie, Christina and I chat fun coding experiments, personifying agents, OpenClaw, hot takes and a little bit of whatnot.

whiskey.fm · youtube · spotify · apple

CSS Infinity Use Cases

2026-07-26 03:57:08

Buzz light year showing flying with a title showing css infinity and beyond

CSS infinity (and -infinity!) solve some pretty specific problems elegantly, but can also just be plain fun to use.

Showing support for infinity, -infinity, NaN, pi, and e

Lets spur creative CSS juices with infinity and follow a couple use cases.

Basics and gotchas #

infinity and -infinity need to always be wrapped in calc().

If you want it to represent a dimension, it also needs to be multiplied by a unit like:

div {
  border-radius: calc(infinity * 1px);
  z-index: calc(infinity);
}

Not quite limited to calc() too, you can use it with other calc()-like scenarios like clamp(), min(), max(), etc, which we'll dig into a bit 🤘🏻

1. Circles and Pills #

Before infinity, I would have used scientific notation like 1e9px (which is 1000000000px) to create a "big enough" radius for circles and pills at any size.

But with infinity..!?

.radius-full {
  border-radius: calc(infinity * 1px);
}

2. Perma-state #

Setting duration calc(infinity * 1s) makes an animation/transition so long that it appears to be frozen ⛄️

Hover over those boxes and the duration will be pinned to happen over infinity seconds, sticking the state for the duration of the page's life.

I like how the duration of your hover is permanently made visible too. Visible millisecond duration via background color.

3. z-index #

Need to beat z-index: 999999999 or something?

.tippy-top-of-stacking-context {
  z-index: calc(infinity)
}

This will max out at the largest int a browser allows: 2147483647. Speaking of that number, you can see it by using counters like this:

.css-max-int {
  counter-reset: cssInt calc(infinity);

  &::after {
    content: counter(cssInt);
  }
}

See!

4. To infinity and beyond #

Use calc(infinity * 1px) to remove the floor or ceiling of a clamp.

div {
  inline-size: clamp(
    calc(-infinity * 1px), /* no floor */
    100%, 
    calc(infinity * 1px)   /* no ceiling */
  );
}

5. Freeze view transitions #

Make view transitions never complete.

::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) {
  animation-duration: calc(infinity * 1s);
}

The ::view-transition tree stays in the devtools DOM, giving you an opportunity to inspect or tweak.

You can also freeze and inspect animations using the Animations panel in devtools.

6. Responsive radius #

Another scenario where I would have reached for making a large number with scientific notation, is a responsive border radius.

.viewport-responsive-radius {
  border-radius: clamp(0px, (100vi - 100%) * infinity, 20px);
}

.container-responsive-radius {
  border-radius: clamp(0px, (100cqi - 100%) * infinity, 20px);
}

If the elements inline-size is less than 100vi, the radius will be 0. If it's greater than 100vi, the radius will be 20px.

There are a set of these available in Open Props.

7. Bools #

Clamp an arbitrary number down to exactly 0 or 1, then use it:

.flippy {
  --solo: clamp(0, (2 - sibling-count()) * infinity, 1);
  --crowded: clamp(0, (sibling-count() - 5) * infinity, 1);

  flex-grow: calc(1 - var(--solo));
  font-size: calc(1rem - var(--crowded) * 0.125rem);
}

One variable now can drive color, offset, opacity, gaps, whatever.

8. Backdrop #

You can use the spread feature of box-shadow to create a non-interactive backdrop:

.backdrop {
  box-shadow: 0 0 0 calc(infinity * 1px) #0005;
}

Paint past the "entire viewport".

9. Scroll Trigger #

Trigger a scroll driven transition in, and never transition out.

.nav-title {
  timeline-trigger-activation-range-end: calc(infinity * 1px);
}

.product-title {
  animation: slide-and-fade 150ms ease both;
  animation-trigger: play-forwards play-backwards;
}

Though you'll see in the demo I use scroll 100% which is a specced way that feels closer to the intent I was going for, in that I wanted the range end to be the end of the scroll area.

Try it:

See the Pen by Adam Argyle (@argyleink) on CodePen.

Also, just for funsies to share, here's the scroll driven version of the same navbar effect. Doesn't use infinity, but fun to try and compare scroll-triggered vs scroll-driven animation.

See the Pen by Adam Argyle (@argyleink) on CodePen.

Thats all #

Hope you found that interesting!

Comment with your own creative uses of infinity?

WWW Ep249 With Joel Hooks

2026-07-24 03:57:08

Whiskey web and whatnot episode 247

Ep #249
Live at React Miami with Joel Hooks

Robbie, Joel and I chat about Pi, OpenClaw, JoelClaw, YOLO mode, AGI, custom harnesses and a little bit of whatnot.

whiskey.fm · youtube · spotify · apple

WWW Ep248 Live At React Miami With Guests Jason Lengstorf And Kent C Dodds And Tanner Linsley And Francesco Cuilla

2026-06-26 05:58:32

Whiskey web and whatnot episode 248

Ep #248
Live at React Miami with guests Jason Lengstorf, Kent C. Dodds, Tanner Linsley and Francesco Ciulla

Robbie and I chat with 4 guests in 1 episode!

Topics span things like Lambo's, MCP vs OpenClaw, agents building agents, polymorphic UI libraries, SDD + state machines, how Prolog is the most hated programming language, and whatnot.

whiskey.fm · youtube · spotify · apple

Presented by GitKraken and Clerk

WWW Ep247 Live At React Miami With Ken Wheeler

2026-06-20 14:38:14

Whiskey web and whatnot episode 247

Ep #247
Live at React Miami with guest Ken Wheeler

Robbie, Ken and I chat about proxies, pranks, survival bags, agent swarms and Ramon the 420 IQ Gorilla.

whiskey.fm · youtube · spotify · apple