Skip to content

Instantly share code, notes, and snippets.

@remy
Created May 22, 2018 10:48
Show Gist options
  • Save remy/078d9b552b7d580e8c30c68434ee41c1 to your computer and use it in GitHub Desktop.
Save remy/078d9b552b7d580e8c30c68434ee41c1 to your computer and use it in GitHub Desktop.

What is your opinion about CSS-in-JS?

I had some "interesting" responses on Twitter over an observation I had that CSS-in-JS doesn't often come with a relatable use-case.

My opinion has always been: use the best tool for the job. When I first looked at CSS-in-JS it was because I was using a pattern library that included a 200K CSS file (compressed!). This wasn't okay. I wanted to only deliver the CSS that I was using in my components. CSS-in-JS appears to be a good match for this problem.

Coupled with the promise of scoped styled (i.e. no global styles interfering), the ability to automatically ensure only the used CSS is delivered, CSS-in-JS has its appeals.

The killer feature for me though, is if some CSS-in-JS tool can provide automatic, configuration-free, critical CSS.

I do know that I'll continue to use stylesheets when I want to avoid the headache of tooling though!

How do you motivate yourself to keep working on tools like jsbin which, while massively useful to the community, appear to suck up a lot of your time? Is it a labour of love, does it generate enough money to keep you going, or is there something else that keeps you going?

That age old existential question: why?!

Honestly, every few months I hit an emotional rain cloud and ask myself this very question and rarely turn up a good answer. But, I do know why.

A very small part of my public work generates paid work. Though, I think it's by reputation, and probably by the sheer amount of code and time I've put out to the web. But this isn't the motivator.

Sometimes it's love (thinking of jsbin) but I've also fallen out of love with projects (again, thinking of jsbin). I do think a bit of love is good for work, but I also think it's easy for the project to slip into a negative relationship. But it's not that either.

My projects are primarily a creative outlet for me. A place to practice my skill and to learn from new mistakes. A place to solve puzzles and play with code.

The why? For fun. Mostly ;-)

How much has financial support for your open source projects impacted the amount of time you work on them?

I've been publishing and contributing open source content for over a decade now, and until relatively recently I've never had any financial support from (or for) these projects.

If you install nodemon today, you'll see a pledge for support on https://opencollective.com/nodemon. As much grief as I got for the message, it turns out that it does work.

Nodemon now has supporters. Recently, I even invoiced a small fee for closing issues, landing fixes and maintaining the project.

For me, knowing that there's a small amount of money coming in, gives me the motivation on two fronts:

I feel responsible to those supporters, to show the project still lives.

I don't resent the time I spend on the project because I know there are individuals and companies that value my work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment