defunctzombie / npm-css

Require css from npm
MIT License
128 stars 8 forks source link

How do you use rework variables with npm-css? #7

Closed techwraith closed 11 years ago

techwraith commented 11 years ago

I'm trying to concat all of my deps together and then run the result through rework, but npm-css seems to be eating any css rule that has a variable in it.

var file = npmcss('/absolute/path/to/file');
var css = rework(file);
css.use(variables(vars))
console.log(css.toString());
techwraith commented 11 years ago

For reference, this is the variables function: https://github.com/jonathanong/rework-variables

techwraith commented 11 years ago

Actually, after further investigation, it looks like npm-css just returns early without an error when it hits invalid css.

Is this expected?

defunctzombie commented 11 years ago

Probably has to do with the parsers we are using. Most likely expect valid CSS. On Aug 3, 2013 2:02 AM, "Daniel Erickson" notifications@github.com wrote:

Actually, after further investigation, it looks like npm-css just returns early without an error when it hits invalid css.

Is this expected?

— Reply to this email directly or view it on GitHubhttps://github.com/shtylman/npm-css/issues/7#issuecomment-22052146 .

techwraith commented 11 years ago

Any recommendations?

techwraith commented 11 years ago

Looks like it will work if I use https://github.com/visionmedia/rework-vars

defunctzombie commented 11 years ago

Do you no longer have this issue now?

techwraith commented 11 years ago

Technically the issue still persists, but I found a work around.