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

Prop For That

2026-06-14 06:58:10

A screenshot of the prop-for-that kitchen sink homepage hero area

Announcing Prop For That, a JS library that backfills what CSS doesn't provide us yet (and maybe never will).

I'm done waiting for CSS to catch up to all the valuable information JS knows and done watching folks write the same little JS to just write a custom property to a component.

demo · docs · npm

Here's a basic example taking the value from a range slider to draw a nice gradient that fills up the slider:

import 'prop-for-that/auto'
// or import 'https://esm.sh/prop-for-that/auto'
<input type="range" data-props-for="range" min="0" max="100" value="40" />
input[type="range"] {
  background: linear-gradient(
    to right in oklab,
    var(--theme) calc(var(--live-value-pct) * 100%),
    var(--track) 0
  );
}

codepen · docs example · codepen collection

Why? #

It's super common to need a few lines of JS for a simple thing like:

  • the value of the color input
  • the mouse pointer position
  • the size of the scrollbar
  • the colors present in an image or video
  • the battery level
  • an element's visibility
  • etc

With Prop For That, you just declaratively specify on any element the props you want, and live props show up.

There's an imperitive API too, but the data attribute path is the slickest

Everything is a plugin that loads only if you need it too, ultimately putting you right where you wanted to be: creating something sick in CSS using dynamic information without wiring up some dorky JS.

What kind of props? #

My talk at CSS Day was an enumeration of all the ways CSS can adapt to users, contexts, pages, etc… which made me hyper aware of all the ways CSS couldn't adapt without JS.

Here's a flat list of all the live props currently supported by the library:

  1. Pointer x/y in the window
  2. Pointer x/y inside/local to an element
  3. Viewport pixel height/width values
  4. Visual viewport information
  5. Element size information
  6. Element visibility
  7. Scrollbar and thin scrollbar sizes
  8. Input element values
  9. Input element dirty, touched, pristine, etc
  10. Select element value, index, count, etc
  11. Colors from an image or gradient (average, accent, light, dark, etc)
  12. Colors occuring in a video
  13. Video progress
  14. Image loaded or broken + natural h/w
  15. Clock time
  16. FPS
  17. Online/offline status
  18. Page focused/visible
  19. Scroll velocity
  20. Accelerometer and device tilt/orientation
  21. Geolocation
  22. DPR, CPU cores, memory
  23. Page navigation type (reload, back, etc)

And a few Chromium only props:

  1. Network status like type, speed, save data, etc
  2. Battery status
  3. CPU pressure

Style Queries #

Style Queries being in all major browsers marks an important milestone for CSS, and made this library much more viable.

Using Prop For That with Style Queries looks like this:

import 'https://esm.sh/prop-for-that/auto'
<form data-props-for="form-state">
  <input name="name" required>
  <input name="email" type="email" required>
  <button type="submit">Save</button>
</form>
@container style(--live-all-valid: 1) {

}

Bye noise #

Import, add attribute(s), have CSS fun.

Go make cool shit and share it with me 🤘🏻💀

Contextualism Talk At CSS Day 2026

2026-06-12 18:13:27

Contextualism title slide from the website

✅ talk "Contextualism" at CSS Day 2026

Slides · Prop For That

WWW Ep246 AI Harnesses Framework Wars And Why Beards Beat Mustaches

2026-06-11 17:55:53

Whiskey web and whatnot episode 246

Ep #246
React Miami with guest Michael "Micky" Shimeles (AKA Rasmic)

Robbie, Micky and I chat about AI, frameworks, and the eternal beard vs mustache debate with a hilarious and fun guest.

whiskey.fm · youtube · spotify · apple

CSS Day 2026

2026-06-08 23:29:06

A pile of CSS Day sticker swag is on a table

🛬 Landed and stoked for CSS Day 2026!

💀 Tattoo scheduled
🤜🤛 Excited to see fellow CSS nerds
🎁 Have a special surprise at the end of my talk that I can't wait to reveal

A Standard Site

2026-06-06 07:32:30

This blog is now a standard.site 🤘🏻

WWW Ep245 The Death Of Typing With Typecraft At React Miami

2026-06-06 04:05:39

Whiskey web and whatnot episode 245

Ep #245
Live at React Miami with Typecraft (Chris)

Robbie and I chat with Typecraft, chat tech and extract some 🔥 hot takes.

whiskey.fm · youtube · spotify · apple