-
Notifications
You must be signed in to change notification settings - Fork 83
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
Fix header logo block size #356
Conversation
padding: 0; | ||
.logo { | ||
width: auto; | ||
max-height: 4rem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a better solution would be to leave img-fluid
for the logo and add max-height: 4rem to the navbar-brand
class as you say @NeOMakinG
WDYT? @mparvazi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont forget we need to think about CLS, space for the logo must be preserved before it loads, otherwise the page will jump.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this with lazy-load script?
<img class="logo"
src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="
data-lazy="{$shop.logo_details.src}"
alt="{$shop.name}"
width="{$shop.logo_details.width}"
height="{$shop.logo_details.height}"
>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's bad practice to give a lazyload above the fold, there may be problems with CLS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that was stupid, forget about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{$max_logo_height = 75}
{$ratio = 1}
{if $shop.logo_details.height > $max_logo_height}
{$ratio = $max_logo_height / $shop.logo_details.height}
{/if}
<img
class="logo img-fluid"
src="{$shop.logo_details.src}"
width="{$shop.logo_details.width * $ratio}"
height="{$shop.logo_details.height * $ratio}"
/>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's look fine for me, and the navbar-brand
with inline-flex
class just like in your PR
@Hlavtox should we take over this or can we close it? |
Closing it because it didn't move for months, let's open it again is someone wants to do something about it |
Part of #340
Screencast-from-07-21-2022-01_21_22-PM.mp4