0

Does anyone know how to prevent your custom theme from inheriting from a parent theme like blank or luma?

This apparently is adding its own css, and js, files to the page and is interfering with our own custom css, and js, files. And this is causing the store or page not to display correctly, or the way we want.

Thanks, Mike

Magedev2301
  • 230
  • 2
  • 22
pollom
  • 3
  • 2

1 Answers1

0

Navigate to app/design/frontend/VENDOR/THEME/theme.xml and remove this line:

    <parent>Vendor/theme</parent>

Your theme will no longer use any files from any other themes, the templates and XML will load from the modules.

Ben Crook
  • 15,685
  • 3
  • 52
  • 104
  • Thanks for your reply Ben.

    I tried that and I'm still getting erroneous stuff added to the page, files like styles-m.css and styles-l.css. In addition, there seems to be additional HTML added.

    – pollom Dec 05 '17 at 17:23
  • If you've removed that line it must be coming from a module? My answer here goes through setting up a theme with no parent and explains how to remove the CSS https://magento.stackexchange.com/questions/112655/theming-for-magento-2-starting-from-scratch/113592#113592 – Ben Crook Dec 05 '17 at 21:44
  • This what is being added automatically that I want to prevent from loading:

    vendor/magento/module-theme/view/frontend/templates/page/js/require_js.phtml

    vendor/magento/module-theme/view/frontend/templates/html/container.phtml

    Does your article take care of this?

    – pollom Dec 06 '17 at 17:12
  • I should have mentioned it before and that is that we migrated from 1.7.0.2 to 2.2 using the data migration tool. Should we run the code migration tool? Does that come into play with this stuff we're talking about? – pollom Dec 06 '17 at 17:36
  • Ahh, if it's coming from vendor/magento it will always fall back to this as they're core files. You'd need to manually remove each of these as far as I'm aware. – Ben Crook Dec 07 '17 at 09:50