3

What if i don't declare parent theme in theme.xml while creating new theme in magento 2? will the new theme work properly?

2 Answers 2

1

Parent theme is necessary in Magento, if you don't want any parent theme, you can use blank theme as your parent theme:

<parent>Magento/blank</parent>

And this wont be an issue, your theme will work properly if you do this.

See dev docs for details

2
  • that means without giving parent node, new theme wont work? so its mandatory to add the parent node?
    – Mukesh
    Commented Feb 13, 2019 at 12:20
  • Yes it is mandatory. you can see dev docs of magento for more details: edited my answer Commented Feb 13, 2019 at 12:46
5

We can create a new theme without depending any parent theme like Magento blank theme vendor/magento/theme-frontend-blank/theme.xml, the difficulty is you need to write all the look and feel changes from the scratch.

My suggestions is use blank theme as a parent theme, if you totally want to change any layout or build the styles from the scratch for the specific layout, use the parent layout override concept.

I hope it helps.

2
  • yup true....we do not need to write code for all look and feel, that's why we use parent theme...
    – Mukesh
    Commented Feb 13, 2019 at 12:30
  • check my updated answer. Commented Feb 13, 2019 at 12:33

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.