1

I would like to know if it is possible to merge css and scss file into one. I use Symfony 2.7 and my config.yml look like this:

assetic:
    assets:
        main:
            inputs:
                - %kernel.root_dir%/../vendor/morrisjs/morris.js/morris.css
                - %kernel.root_dir%/../vendor/twbs/bootstrap-sass/assets/stylesheets/*
            output: 'css/main.css'
            filters:
                - sass
                - cssrewrite
    filters:
        cssrewrite: ~
        sass:
          bin: C:\Ruby21-x64\bin\sass
          apply_to: "\.scss$"

When I try to dump assets with

php app/console assetic:dump

I have an error with this because sass is trying to parse the css file. Why "apply_to" doesn't work ?

I saw this post but it dosen't help me...

Community
  • 1
  • 1
Médéric
  • 13
  • 4
  • What is your error ? Post the error text ... – tchap Oct 13 '15 at 15:31
  • The error doesn't really matter, it's the same kind of error you get when you try to parse a css file with sass: `'Error Output: WARNING on line 1 of C:\cygwin64\tmp\ass2DDF.tmp: This selector doesn't have any properties and will not be rendered. WARNING on line 2 of C:\cygwin64\tmp\ass2DDF.tmp: This selector doesn't have any properties and will not be rendered. Error: Invalid CSS after ".morris-hover": expected selector, was "{position :absol..."` – Médéric Oct 13 '15 at 15:34

1 Answers1

0

Since you're using an apply_to parameter, I think you should explicitely remove the sass filter from your assetic stanza :

assetic:
    assets:
        main:
            inputs:
                - %kernel.root_dir%/../vendor/style.css
                - %kernel.root_dir%/../vendor/sass/*
            output: 'css/main.css'
            filters:
                - cssrewrite
    filters:
        cssrewrite: ~
        sass:
          bin: C:\Ruby21-x64\bin\sass
          apply_to: "\.scss$"

See this issue for instance

tchap
  • 3,412
  • 3
  • 29
  • 46
  • You are right ! I didn't find this issue but it works. I just fell uncomfortable with this because it looks like all hidden but thanks ! – Médéric Oct 13 '15 at 15:52