Differend Stylesheets for layouts

Hello, I am using Yii2 Basic. Now I have two layouts for site and dashboard. Is it possible to use two different style sheets for these layouts? The head function in the layout always includes style.css. can i change this?

I use now a differend AppAsset. it works fine

You just need to create 2 layouts files.

Yes i know and i do that. But i will use differend style-sheets for differend layouts.

Just make two different asset management classes and register them, each one to its respective layout. Each class will have its CSS. Add finally in each module/controller/app, setup to use correct layout!

Thank you Stefano. Exactly this is what i do now :slight_smile:

1 Like