0

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

Shoaib Munir
9,59210 gold badges54 silver badges109 bronze badges
asked Feb 4, 2019 at 5:24

1 Answer 1

0

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

answered Feb 4, 2019 at 5:37

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.