> this seems to be a way to write the complete CSS in JS, and then to have it compiled into CSS.That isn't what this is although I also had to poke around the source code to figure out what it is exactly.
It's a set of mixins and utility functions that return a js object that is then used as input for either inline styles, or for one of the may CSS in JS libraries that convert do a JS object to CSS.
As for how useful? Well, the color utilities seem to replicate what color.js does, so nothing new there. The mixins seem to be mostly about prefixing, and you're going to need to prefix the rest of your CSS-in-JS anyway - for which there are various standalone libraries, and plugins to the aforementioned libraries.
The shorthands let you do things like:
borderWidth('12px', '24px', '36px', '48px')
=>
{
'border-top-width': '12px',
'border-right-width': '24px',
'border-bottom-width': '36px',
'border-left-width': '48px'
}
Thing is, I can already do that without the expansion:
{
'borderWidth': '12px 24px 36px 48px'
}
As much as I respect the guys behind this, I'd question how useful it is overall.