0

I need to load the css file THEME\Magento_Checkout\web\css\checkout\index\index.css in the checkout page only.

So I created the file THEME\Magento_Checkout\layout\checkout_index_index.xml and added a layout instruction:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
 <head>
 <css src="Magento_Checkout::css/checkout/index/index.css"/>
 </head>
</page>

I can see in the source code that it tries to load the script, but if I open it then I get

Compilation from source: LESS file is empty: frontend/company/base/de_DE/css/checkout/index/index.less

asked Mar 19, 2020 at 15:10

1 Answer 1

0

I solved it by executing grunt clean. Now after loading the source code site again, it shows

https://example.com/pub/static/version1584630764/frontend/company/base/de_DE/Magento_Checkout/css/checkout/index/index.css"

instead of

https://example.com/pub/static/version1584630764/frontend/company/base/de_DE/css/checkout/index/index.css"

and it works.


Hint: If you don't use grunt, then you will have to manually delete the folders pub/static/frontend and var/view_preprocessed

answered Mar 19, 2020 at 15:15

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.