Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG Logo is not sized appropriately #8

Open
xeruf opened this issue May 16, 2022 · 3 comments
Open

SVG Logo is not sized appropriately #8

xeruf opened this issue May 16, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@xeruf
Copy link

xeruf commented May 16, 2022

Solidus Version:
3.1.5

To Reproduce

Configure an SVG logo in config.logo

Current behavior
The logo is not shown at all since the img is sized to 0:
image
image

Expected behavior
SVG is sized appropriately.

More
Similar issues with PNG: It is not downsized appropriately if a bigger png is used.

I wanted to try and work this out myself, but I am unable to find where the logo is defined which is included in the _header.html.erb:
<figure id="logo" class="columns six" data-hook><%= logo %></figure>

@kennyadsl
Copy link
Member

Hey @xeruf, does the SVG image have the width and height attributes set?

Here's the code of the SVG image we provide with the default frontend, as a reference: https://github.com/solidusio/solidus/blob/093fad109bf79b014d59fda1b2a86f7b94248052/logo.svg?short_path=24a2648

@jarednorman
Copy link
Member

Just to add to that, SVG sizing is a little tricky and depends on whether or not the width, height, and viewbox attributes are set and what they are set to.

@xeruf
Copy link
Author

xeruf commented May 16, 2022

it has this: viewBox="0 0 95 95" - either way, why not simply add an appropriate height attribute to the image?

@kennyadsl kennyadsl transferred this issue from solidusio/solidus Aug 29, 2022
@gsmendoza gsmendoza added the bug Something isn't working label Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants