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

scss_formatter_compressed doesn't strip CSS comments #60

Closed
PaulSpr opened this issue Mar 12, 2013 · 7 comments
Closed

scss_formatter_compressed doesn't strip CSS comments #60

PaulSpr opened this issue Mar 12, 2013 · 7 comments

Comments

@PaulSpr
Copy link

PaulSpr commented Mar 12, 2013

When you use the scss_formatter_compressed flag, scss comments are stripped (the // type), but regular CSS comments ( /**/ style) are left in the CSS.

From what I understand this is expected SASS behavior. But when you compress the CSS output, shouldn't it be as small as possible?

@jamesshannon
Copy link
Contributor

I'm not up on the sass spec, but I don't think all formatters need to follow it. If we want a formatter that outputs in CSSHaiku, that should be an option.

I would make sense, though, to be an extension of the compressed class so that the original is available.

I don't know how related this is, but I notice that when I use the compress formatter, the normal comments (/* */) of all the imported files get pushed to the top of the output file, before the actual output code from files that come before it. I haven't done a lot of debugging / confirmation, so not yet ready to file this as a separate issue, but thought I'd mention it.

@clue
Copy link
Contributor

clue commented Mar 25, 2013

I have a temporary working branch that adds an option to remove CSS comments from the output laying around for several months. In this patch, stripping comments is enabled only for the scss_formatter_compressed, but can be toggled through a flag in all formatters (which is the current behavior for most other flags as well).

Before opening a PR, it'd like to address ticket #63 and make sure it's desired to enhance the default compressed formatter or introduce a whole new formatter instead. In particular, there are a whole lot of other enhancements and CSS minimizations in this branch (feel free to take a look), which I'd like to see merged back to the master at some point.

@robocoder
Copy link
Collaborator

+1 for a new formatter

@Colir
Copy link

Colir commented Feb 5, 2014

Hi,
can you please explaine me hox to use scss_formatter_compress
I didn't understand how to set up it
thanks

@robocoder
Copy link
Collaborator

I've added the scss_formatter_crunched class to the develop branch.

@robocoder
Copy link
Collaborator

@Colir programmatically:

$scss = new scssc();
$scss->setFormatter('scss_formatter_compressed');

Using pscss:

pscss -f=scss_formatter_compressed <yourfile.scss

@marcandrews
Copy link

Thanks

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

No branches or pull requests

6 participants