css - Sass / Compass in Symfony2 -
i try'in use scss files symfony2 , asseticbundle.
my config.yml assetic part:
assetic: debug: %kernel.debug% use_controller: false bundles: [] filters: sass: ~ compass: ~ #closure: # jar: "%kernel.root_dir%/resources/java/compiler.jar" #yui_css: # jar: "%kernel.root_dir%/resources/java/yuicompressor-2.4.7.jar"
my base.html.twig :
<!doctype html> <html> <head> <meta charset="utf-8" /> <title>{% block title %}welcome!{% endblock %}</title> {% block stylesheets %} {% stylesheets filters="compass" "@testbundle/resources/public/sass/main.scss" %} <link rel="stylesheet" href="{{ asset_url }}" /> {% endstylesheets %} {% endblock %} <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" /> </head> <body ng-app="myapp"> {% block body %}{% endblock %} {% block javascripts %} <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> <script src="https://code.jquery.com/jquery-2.1.3.min.js"></script> <script src="{{ asset('js/app.js' ) }}" /> {% endblock %}
my main.scss in testbundle/resources/public/sass/main.scss
$background: #000; body{ background-color:$background; }
this error im getting:
unexpected token "name" of value "filters" in app/resources/views/base.html.twig @ line 7
in case issue in filters word had filter. try change
{% stylesheets filters="compass" "@testbundle/resources/public/sass/main.scss" %}
to
{% stylesheets filter="compass" "@testbundle/resources/public/sass/main.scss" %}
Comments
Post a Comment