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

Support 'compact' output style. #838

Closed
davidangel opened this issue Jan 14, 2015 · 7 comments
Closed

Support 'compact' output style. #838

davidangel opened this issue Jan 14, 2015 · 7 comments
Assignees
Milestone

Comments

@davidangel
Copy link

I think support for the 'compact' output is important to have. Especially since gulp-sass, and therefore nose-sass depends on libsass. The 'compact' output style is useful when trying to keep source maps correct when piping through other plugins.

Thanks.

@am11
Copy link
Contributor

am11 commented Jan 19, 2015

@davidangel, while this is a great idea, but you may want to consider using the alternative approach meanwhile.

Since node.js is blessed with postcss a foundationally package, you can use packages like csswring to re-wire the source-maps:

var postcss = require('postcss');
var csswring = require('csswring');
var nodeSass = require('node-sass');

var result = noseSass.renderSync({file: 'test.scss');

postcss().use(
  csswring.postcss
).process(result.css);

Or if you want to consume autoprefixer (yet another postcss based package which lets you configure various vendors' prefixes and autoprefix the output), it won't even require you to use csswring. See sass/node-sass#555 (comment) for example and this for full-scale node-sass example, which runs two postcss processors (Autoprefixer and RTLCss) on the node-sass output, while keeping the node-sass intact.

Also, note that the most optimised and correct minification or CSS or JS is a very complicated and delicate matter. The most efficient CSS minifier IMO and in my experience is CSSO: https://github.com/css/csso (not sure whether they are postcss compatible).

Therefore, for superset CSS languages, Scss, Less, Slylus etc., IMO it does not make much sense to at least "perfect" this aspect, for sake of separation of concerns. I think it would make sense to have a unified minification and source-mapping experience from all these post-processors, rather than the varied and yet fragmented one. (but most probably it is not applicable here, since libsass follows ruby-sass for feature selection)

@xzyfer
Copy link
Contributor

xzyfer commented Jan 20, 2015

The most efficient CSS minifier IMO and in my experience is

There's no right answer here, but this is certainly worth checking out. YMMV. https://github.com/GoalSmashers/css-minification-benchmark

@am11
Copy link
Contributor

am11 commented Jan 20, 2015

@xzyfer, interesting! I haven't tried more-css (!?!). Thanks for the link. :)

@ericnewton76
Copy link

👍

The options present in ruby-sass would be greatly appreciated. 😉

@mgreter
Copy link
Contributor

mgreter commented Mar 2, 2015

This should be solved by #910!

@mgreter mgreter closed this as completed Mar 2, 2015
@ericnewton76
Copy link

Seeing pull request #910 ! Awesome work fellas! Thanks much! 👍

@davidangel
Copy link
Author

Cool!

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

5 participants