admin管理员组文章数量:1434388
I am using the Sass bundle (.html) for Symfony.
I have a file assets/styles/front/main/contenus.scss
:
@import "../variables.scss";
.test {
color: $c-primary;
}
.video {
height: 240px;
}
I include it in my rechercher.html.twig
view like this:
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('styles/front/main/contenus.scss') }}">
{% endblock %}
The code related to the .video
class is interpreted correctly, but I get a console error in the browser stating that the variables.scss
file is "not found":
GET https://127.0.0.1:8000/assets/styles/front/variables net::ERR_ABORTED 404 (Not Found)
However, the _variables.scss
file is indeed present in /assets/styles/front/.
How can I import it?
I am using the Sass bundle (https://symfony/bundles/SassBundle/current/index.html) for Symfony.
I have a file assets/styles/front/main/contenus.scss
:
@import "../variables.scss";
.test {
color: $c-primary;
}
.video {
height: 240px;
}
I include it in my rechercher.html.twig
view like this:
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('styles/front/main/contenus.scss') }}">
{% endblock %}
The code related to the .video
class is interpreted correctly, but I get a console error in the browser stating that the variables.scss
file is "not found":
GET https://127.0.0.1:8000/assets/styles/front/variables net::ERR_ABORTED 404 (Not Found)
However, the _variables.scss
file is indeed present in /assets/styles/front/.
How can I import it?
Share Improve this question edited Nov 19, 2024 at 13:24 Alan asked Nov 18, 2024 at 10:47 AlanAlan 1351 gold badge3 silver badges14 bronze badges 3 |1 Answer
Reset to default 1Try it withouth the extension, so just @import "../variables";
And if You have the contenus.css file too, check if the variable file's content is in there or not.
本文标签: Sass bundle with Symfonyimport issueStack Overflow
版权声明:本文标题:Sass bundle with Symfony : import issue - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745625174a2666927.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
php bin/console sass:build
? And did you excludescss
from AssetMapper? – Michael Sivolobov Commented Nov 19, 2024 at 16:49