j2css / j2c

CSS in JS library, tiny yet featureful
https://j2c.py.gy
167 stars 8 forks source link

Consider CLI JS -> CSS converter #23

Open nwmcsween opened 8 years ago

nwmcsween commented 8 years ago

It's quite cumbersome cping a runner to convert js to css for every project.

pygy commented 8 years ago

Could you provide more details on your current workflow?

Do you want a utility that takes in JSON and outputs CSS?

nwmcsween commented 8 years ago

something like j2c es6-export-file-with-computed-properties.js -o somefile.css

On 2016-03-18 3:02 PM, Pierre-Yves Gérardy wrote:

Could you provide more details on your current workflow?

Do you want a utility that takes in JSON and outputs CSS?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/j2css/j2c/issues/23#issuecomment-198561242

pygy commented 8 years ago

Now that's tricky because ES6 module bindings are static, and they are obviously not supported natively, so there are more than one way to consume them... I'll have to think about it.

In the mean time, you could, programmatically, generate files with something like:

#! /usr/bin/env node
/* 
j2cgen.js
usage: 
    j2cgen.js filename > destination
*/
console.log(`
import sheet from '${process.argv[2]}';
import j2c from 'j2c';
console.log(j2c.sheet(sheet));
`)

Or is it what you meant by "cping a runner"?

nwmcsween commented 8 years ago

You could use a System.import shim. That example is what i meant by the "cping a runner" as i have to do that with every project.

On Fri, Mar 18, 2016, 3:49 PM Pierre-Yves Gérardy notifications@github.com wrote:

Now that's tricky because ES6 module bindings are static, and they are obviously not supported natively, so there are more than one way to consume them... I'll have to think about it.

In the mean time, you could, programmatically, generate files with something like:

! /usr/bin/env node/* j2cgen.jsusage: j2cgen.js filename > destination*/console.log(import sheet from '${process.argv[2]}';import j2c from 'j2c';console.log(j2c.sheet(sheet));)

Or is it what you meant by "cping a runner"?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/j2css/j2c/issues/23#issuecomment-198570771

pygy commented 8 years ago

Ah, yes, SystemJS... good call. I've never used it, though...

I'll look into this later on, but my current priority is getting v1.0 out (mostly docs now).

nwmcsween commented 8 years ago

It's not just SystemJS, it's in ES6, any shim for System.import will work.

On 2016-03-18 4:26 PM, Pierre-Yves Gérardy wrote:

Ah, yes, SystemJS... good call. I've never used it, though...

I'll look into this later on, but my current priority is getting v1.0 out (mostly docs now).

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/j2css/j2c/issues/23#issuecomment-198582274