13
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Symfony2でSass、Compassを使う方法

Posted at

Sass/Compassインストール

gem install sass
gem install compass

config.yml

assetic:
    debug:          %kernel.debug%
    use_controller: false
    filters:
        sass:    ~
        compass: ~

Twig

{% stylesheets filter="compass"
    "@DemoBundle/Resources/public/sass/main.sass"
    "@DemoBundle/Resources/public/sass/header.sass"
    "@DemoBundle/Resources/public/sass/footer.sass"
%}
    <link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}

sassファイル編集するたびにコンパイルしなくてもいい。

production環境でアクセスする前に

php app/console assetic:dump --env=prod --no-debug

しておかないと動かないので注意

13
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?