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

Fix header logo block size #356

Closed
wants to merge 1 commit into from

Conversation

mparvazi
Copy link
Member

Part of #340

Screencast-from-07-21-2022-01_21_22-PM.mp4

padding: 0;
.logo {
width: auto;
max-height: 4rem;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've some doubts, should we constraint the height of the logo itself or the navbar? So it adapts to every situations

Would love your opinion @SharakPL @Hlavtox , seems like my integrations skills are getting rusty these days

Copy link
Contributor

@JBLach JBLach Aug 4, 2022

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed height navbar-brand & img-fluid logo

Screenshot from 2022-08-04 15-43-17

Copy link
Contributor

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.

Copy link
Member Author

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}"
>

Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Member Author

@mparvazi mparvazi Aug 4, 2022

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}"
/>

Copy link
Contributor

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

@NeOMakinG
Copy link
Contributor

@Hlavtox should we take over this or can we close it?

@NeOMakinG
Copy link
Contributor

Closing it because it didn't move for months, let's open it again is someone wants to do something about it

@NeOMakinG NeOMakinG closed this Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants