
Sign up to save your podcasts
Or


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:
codepen · docs example · codepen collection
It's super common to need a few lines of JS for a simple thing like:
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.
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:
And a few Chromium only props:
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, add attribute(s), have CSS fun.
Go make cool shit and share it with me 🤘🏻💀
By 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:
codepen · docs example · codepen collection
It's super common to need a few lines of JS for a simple thing like:
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.
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:
And a few Chromium only props:
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, add attribute(s), have CSS fun.
Go make cool shit and share it with me 🤘🏻💀