0

I am new to Magento 2. I am having difficulty in creating a child theme. However I have created the child theme now I am facing how to add source for child them.

In my configuration, I have created child theme of Luma, which is child theme of Magento blank theme. I want to extend all css from either parent or grand parent. So decided to not give same name which already exist in parent theme (luma).

I am planning to add _extend-child.less to the parent theme and keep it blank. And creating same filename in child theme where I can add my own CSS or can add call child sources. Now my question is:

  1. As luma theme is primarily present in vendor directory. I cannot add _extend-child.less here as it might override on upgrade. How could I copy this to app/design/frontend/Magento directory?
  2. Does copying the complete folder vendor/magento/theme-frontend-luma/ to app/design/frontend/Magento/ would work?
  3. Does changing code on app/design/frontend/Magento/ would not be affected on theme update/upgrade?
  4. Any standard way to include my child CSS to luma theme.

Thanks in advance.

1 Answer 1

0

If you extend from Luma, you have all CSS of Luma. If you want to extend e.g. Magento_Checkout, you would create _extend.less in Magento_Checkout/web/css/source

If you want to override this CSS completely you would create _module.less.

https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/css-guide/css_quick_guide_approach.html

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.