I added the external bootstap in my custom theme I want to be it before style-l.css I referred Load Custom CSS After style-l.css For Home Page but it's only working from home page, not for other, please help me with this
1 Answer 1
The thread you have mentioned in your question is doing just opposite of your requirement; i.e, it loads a static asset file after style-l.css and style-m.css.
If you want to load your CSS file before those two CSS files and in every page. You need to put your code in default.xml under your theme.
File : app/design/frontend/[Package]/[Theme]/Magento_Theme/layout/default.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Magento_Theme::css/bootstrap.css" />
</head>
</page>
Now insert your bootstrap CSS file at the location app/design/frontend/[Package]/[Theme]/Magento_Theme/web/css/bootstrap.css