2

I'm using assetic within Symfony2 to load all of my assets, and I'm also using the compass filter. All my code is now out of development so I need to compress it if possible. I've looked into the uglifyCSS filters but I don't and probably can't install Node on my server.

Is there a way to make Symfony2 use the Sass --style :compressed functionality so my code is minified when i generate assets?

0

3 Answers 3

4
+50

Some time ago I had the same problem. It is quite easy to overcome, but there is nothing mentioned in the documentation. This is how you do it:

// in config.yml
assetic:
    filters:
        scss:
            style: compressed

This will pass --style argument to sass with the value compressed.

Sign up to request clarification or add additional context in comments.

Comments

2

In you production configuration file you can set :

assetic:
    filters:
        compass:
            # ...
            style: compressed

Comments

0

I use compass to generate the css files directly (using the compass watch command) and have those dumped to the public folder. In compass, you can change the output_style to one of these 4 - :expanded, :nested, :compact or :compressed. Using compressed is the one you would want.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.