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
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
-
that means without giving parent node, new theme wont work? so its mandatory to add the parent node?– MukeshCommented 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
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.
-
yup true....we do not need to write code for all look and feel, that's why we use parent theme...– MukeshCommented Feb 13, 2019 at 12:30
-