Creating a theme logo

By default, in Magento 2 the theme logo is always recognized by the system with the name logo.svg. The Magento 2 also recognizes the logo's default directory as <theme_dir>/web/images/logo.svg. So, if you have a logo.svg file, you simply put the file in the right directory.

But if you want to work with a different logo name with a different format, you have to declare it in Magento by using the layout files declaration. We will make a declaration for this new logo in the Magento_Theme directory, because the new logo overrides the Magento_Theme module.

We will override this module by taking advantage of the fallback system. As you may have noticed, Magento has a specific pattern of declaring elements. It's the way that Magento ...

Get Magento 2 Theme Design - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.