Does anyone know if there's a built in way to define a logo specifically for mobile?
I read somewhere that you could place a logo-small.svg file in app/design/frontend/[vendor]/[theme]/web/images/ but I've not had any success with this yet.
The logo image resides in the following location on the server. Any image file with by that name and at that location is used as the theme logo.
Path:
app/design/frontend/[vendor]/[theme]/web/images/logo.svg
Magento uses a svg
image by default.
This should look fine on every device, even on devices with a high dppx. But
For as far as I know, Magento does not offer a solution to provide a different image or different dimensions for mobile from the backend.
But If the default solution doesn't suit you, you can add your own by modifying the logo.phtml
file. This file should be added in your custom theme at /Magento_Theme/templates/html/header/logo.phtml.
Or _theme.less
file in my custom theme to make it work:
// Mobile Logo Fix
.logo img {
width: auto;
}