Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow redefining parser, syntax and stringifier PostCSS options #4

Closed
Dremora opened this issue Mar 1, 2016 · 3 comments
Closed

Allow redefining parser, syntax and stringifier PostCSS options #4

Dremora opened this issue Mar 1, 2016 · 3 comments

Comments

@Dremora
Copy link

Dremora commented Mar 1, 2016

I've managed to make ember-css-modules work with our SASS codebase, however the solution is just one big hack. Would be nice to have a proper way of doing this. Currently css-modules-loader-core doesn't accept most of the options listed here but this should be fixed with css-modules/css-modules-loader-core#59.

And, while I'm here, just wanted to say thanks for the addon — I've been waiting for something similar for ages! 😆

@dfreeman
Copy link
Member

dfreeman commented Mar 1, 2016

Looks like we'll be able to have all kinds of fun once that PR lands!

I'm interested in that support as well – it would be nice for some legacy parts of our codebase, and "does it work with Sass" is probably the most common question I get about this project :)

@Dremora
Copy link
Author

Dremora commented Mar 2, 2016

Just in case someone reading this is interested in using ember-css-modules with SASS, this is the solution we've implemented. Caution: it's a big hack, you have to add postcss and postcss-scss to your package.json, and postcss should be exactly of the same version as used by ember-css-modules (currently 5.0.10) so that npm could flatten them (and you need to be using fairly recent version of npm). And you might need to do rm -rf node_modules. I've warned you :)

var postcss = require('postcss');
var postCssScssSyntax = require('postcss-scss');

// HACK
var Processor = postcss([]).constructor;
var processorProcess = Processor.prototype.process;
Processor.prototype.process = function (css, opts) {
  opts.syntax = postCssScssSyntax;
  return processorProcess.call(this, css, opts);
}

@dfreeman
Copy link
Member

This is now possible in 0.4.0.

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

No branches or pull requests

2 participants