threepointone/glamor

cli for extracting css from a module

Closed this issue · 7 comments

the goal is to make these work -
glamor ./src/app.js -cc ./src/app.css #css only
glamor -./src/app.js -d lib #html/css/ids
cat src/*.js | glamor | jq #pipe in and out

Hi @threepointone, first I'd like to thank you for creating a great framework. I began using this in my most recent app and am loving so far. I'm interested in helping contributing to this project and want to see if this feature is available for the taking and if you currently have a preference for which CLI toolkit you want to use?

Hi, thanks!

  • I like minimist
  • I have some preliminary work in src/extract.js
  • I also want to support streaming in source/streaming out css, and also outputting a json dump of html/css/ids
  • A complicated part is that src/app.js might be written in babel/jsx/flow/etc, so unsure on a clean way of dealing with that

Can you give me more feedback on your usage? Do you use the css prop shim? What is your usecase? Anything I can make better? Please, and thank you!

Maybe we can do without minimist or a 3rd party package since you have no dependencies right now which is awesome. Perhaps a standalone glamor-cli module would make sense as to keep the size of this repo down and just expose an extract API.

For my usage, I'm currently only using it primarily to compose styles on this app to allow composing with theme modules. Not using the css prop shim though. Haven't really taken a full look at the spec yet since I'm still reading through your code.

minimist is small enough that I think it'll be worth the cost.
dext looks neat! you wouldn't need the cli there though, unless you want to pregenerate styles/ids for fast startup?

I agree with @vutran it is cool that you don't have any dependencies right now, and I think for now it would be okay to pull in minimist as dependency until glamor gains more maturity and then later on, when the project is more stable, it could be nice to split the cli part in an independant package, but I believe right now it would be a pain to maintain.

closing this for now, will open if anyone has anything to show and tell :)