2 ms·
Thanks for making yourself available! I was curious what your thoughts are on a JS-based functional CSS library? I noticed that you mentioned emotion on the do
by cheapsteak 8y ago
Thanks for making yourself available!
I was curious what your thoughts are on a JS-based functional CSS library? I noticed that you mentioned emotion on the docs, and that was also what I thought would be the perfect tool for the job
Imagine a set of functions like `textColor()` or `margin()` that return composeable objects that you'd stick onto css props, and just like tailwinds would throw errors or lint warnings if you didn't pass in values it was configured to allow? (E.g., colors.red, okay, colors.maroon, error? Or maybe colors('red') okay)
I figured it'd more elegantly solve the problem of generating stylesheets that are too large and then needs to be pruned off
One trade-off I see is that the utilities would need to be imported to each file that needs it (as opposed to strings you can put anywhere), but the the good thing about that is you could more easily click into the definitions that way, and you could namespace utilities under a variable so you'd only need to import one thing
I would guess you'd put more thought on this topic than I have, very curious to hear what you think