Sylius/Sylius

Custom theme js and scss files not loading

Ouverte

#15 136 ouverte le 30 juin 2023

 (1 commentaire) (0 réaction) (0 personne assignée)PHP (2 074 forks)batch import
FrontendHelp Wanted

Métriques du dépôt

Stars
 (7 584 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

Sylius version affected: 1.12.8

Description
In documentation it says that loading js and scss files should be in: themes/MYTHEME/assets/shop/styles/app.scss (for scss files)

And then, in 'entry.js' I added: import './css/app.scss';

Then, I ran code: php bin/console sylius:theme:assets:install and also cleared the cache.

Problems are that my app.scss didn't compile to .css file and when I use this in: themes/MYTHEME/templates/bundles/SyliusShopBundle/_styles.html.twig with: {% include '@SyliusUi/_stylesheets.html.twig' with {'path': 'assets/shop/css/app.css'} %} it doesn't find the file.

Steps to reproduce
Use all the previously described steps.

Possible Solution
Missing docs for Sylius 1.12 - describe the correct way to use assets in custom theme.

Guide contributeur