Using compass/sass with Symfony 2

前端 未结 2 437
迷失自我
迷失自我 2021-02-10 11:46

I\'ve been googling around for an answer to this but haven\'t found exactly what I\'m looking for.

I\'m dipping my toes in the water of the Symfony framework having been

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-10 12:18

    This looks like a job for Assetic and its Sass filter.

    You can list all your sass files in main template directory and assetic will do the compressing for you.

    Looks something like this (taken from link below):

    {% stylesheets filters="compass"
        "@AlomMainBundle/Resources/assets/css/main.sass"
        "@AlomMainBundle/Resources/assets/css/header.sass"
        "@AlomMainBundle/Resources/assets/css/footer.sass"
    %}
        
    {% endstylesheets %}
    

    A good explanation I've found on the internet is here: http://alexandre-salome.fr/blog/Sass-Compass-Assetic-In-Ten-Minutes

提交回复
热议问题