【发布时间】:2014-05-02 17:33:15
【问题描述】:
我的项目框架是 Symfony 2.0。我通过 Assetic 使用 Compass 过滤器来编译我的 Sass 文件。但是,一旦我将编译的 CSS 文件放在头部,我不确定如何构建它,因为我有条件代码来加载某些 css 文件。除此之外,我希望能够包含我的 IE 条件。
(i.e.<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="ie7.css">
<![endif]-->).
不确定我是否应该使用我在下面创建的相同 If 语句,或者是否有更优雅的解决方案:
即 CssBundle/Resources/views/stylesheets.html.twig
{% block stylesheets %}
{% if isEspanol %}
{% stylesheets filters=”compass” @cssBundle/Resources/css/core/es/main.desktop.scss” %}
{% else %}
{% stylesheets filters=”compass” @cssBundle/Resources/css/core/main.desktop.scss” %}
{% endif %}
<link rel=”stylesheet” href=”{{ asset_url }}” />
{% endstylesheets %}
CoreBundle/Resources/views/Layout/default.desktop.html.twig
<head>
{% include “::stylesheets.html.twig” %}
</head>
【问题讨论】:
标签: css symfony sass stylesheet compass-sass