bcmcfc
bcmcfc

Reputation: 26825

Defining extra stylesheets on a per-module basis in Symfony

I've created a module called "home" in Symfony.

I want css used by elements found only within this module to be in a separate home.css file.

I've created the file apps/frontend/modules/home/config/view.yml and placed inside it:

default:
    stylesheets: [home.css]

apps/frontend/config/view.yml contains the line:

stylesheets:    [reset.css, main.css]

I was expecting loading the page /home to result in reset.css, main.css and home.css being loaded in that order. However, it loads main.css and then home.css, ignoring reset.css and not placing the files in the desired order.

Am I doing something wrong here? I am new to Symfony.

Upvotes: 0

Views: 587

Answers (1)

Flask
Flask

Reputation: 4996

you must ad "all:" in your view.yml

all:
  stylesheets:    [reset.css, main.css]

for the order of the stylesheets, you could work with "-". If you want that reset and main are loaded before try stylesheets: [-reset.css, -main.css]

Upvotes: 1

Related Questions