Answer the question
In order to leave comments, you need to log in
How to connect styles one in the header, others in the footer?
Hello.
Since google monitors the download speed, I made 2 css files.
1) start.min.css
2) app.min.css
And I would like to include them, one in the header, the other in the footer.
Usually everyone uses the function
$assets->addCss(PUBLIC_ASSET_ROOT_PATH . '/styles/start.min.css');
$assets->addCss(PUBLIC_ASSET_ROOT_PATH . '/styles/app.min.css');
Answer the question
In order to leave comments, you need to log in
Don't use $assets->addCss or don't use it for at least one style group.
I use my own way of adding styles which uses AddViewContent and ShowViewContent.
This is convenient and allows you to include styles and scripts as needed. The current implementation of connecting to Bitrix is outdated by 10 years, but they won’t do it anyway - you won’t show it at the presentation.
// Второй параметр говорит о том, что это дополнительные стили. Должны быть в отдельном файле по идее
$assets->addCss(PUBLIC_ASSET_ROOT_PATH . '/styles/start.min.css', true);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question