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.
php bin/console sass:build
? And did you excludescss
from AssetMapper? – Michael Sivolobov Commented Nov 19, 2024 at 16:49