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

Improvements : small theme improvements #526

Merged
merged 5 commits into from
Jul 3, 2023

Conversation

tblivet
Copy link
Contributor

@tblivet tblivet commented Jun 30, 2023

Questions Answers
Description? This PR has for objective to add some improvements to the theme.
Type? bug fix / improvement
BC breaks? no
Deprecations? no
Fixed ticket? --
Sponsor company @PrestaShopCorp
How to test? --
  1. The breadcrumb has been removed in smarty from the homepage instead of making him invisible with CSS.
  2. A condition has been added on jsonld data to adapt the "Type" if a product has a brand associated or not.
  3. The loading attribute of ps_imageslider images has been optimized, the first image is charge with the loading parameter value eager which is better in terms of performance because the first image is identified as the LCP.
  4. Improve the responsiveness of the pagination on category pages which have a lot of pages, like in the capture below, which show a content overflow on small devices:

image

Copy link
Contributor

@kpodemski kpodemski left a comment

Choose a reason for hiding this comment

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

Looks good!

@kpodemski kpodemski requested a review from Hlavtox June 30, 2023 18:00
@Hlavtox
Copy link
Contributor

Hlavtox commented Jun 30, 2023

@tblivet Good job dude, I love the level of attention to details! 🔥

@kpodemski kpodemski added this to the Beta milestone Jun 30, 2023
Copy link
Contributor

@SharakPL SharakPL left a comment

Choose a reason for hiding this comment

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

All good. Just small suggestions.

@@ -20,7 +20,7 @@
aria-hidden="{if $smarty.foreach.homeslider.first}false{else}true{/if}">
{if !empty($slide.url)}<a class="carousel-link" href="{$slide.url}">{/if}
<figure class="carousel-content">
<img src="{$slide.image_url}" alt="{$slide.legend|escape}" loading="lazy" {$slide.size|replace: '"':''}>
<img src="{$slide.image_url}" alt="{$slide.legend|escape}" {if $slide@iteration == 1}loading="eager"{else}loading="lazy"{/if} {$slide.size|replace: '"':''}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<img src="{$slide.image_url}" alt="{$slide.legend|escape}" {if $slide@iteration == 1}loading="eager"{else}loading="lazy"{/if} {$slide.size|replace: '"':''}>
<img src="{$slide.image_url}" alt="{$slide.legend|escape}" {if $slide@first}loading="eager"{else}loading="lazy"{/if} {$slide.size|replace: '"':''}>

But since loading="eager" is the default then it would be best to only add loading="lazy" for every item except the first one.

Comment on lines 10 to 14
&-container {
align-items: center;
margin: 1rem 0;
margin-top: 1rem;
margin-bottom: 1rem;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather add proper classes to the template (my-3 align-items-center) instead of duplicating CSS that is already in Bootstrap. The theme should be as light as possible. Custom CSS should be added only to custom components that can't be styled directly with BS or in loops to limit the size of compiled php file

@hibatallahAouadni hibatallahAouadni self-assigned this Jul 3, 2023
Copy link

@hibatallahAouadni hibatallahAouadni left a comment

Choose a reason for hiding this comment

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

Hello @tblivet

  • The breadcrumb has been removed in smarty from the homepage ✔️
  • The loading attribute of ps_imageslider images has been optimized ✔️
  • Improve the responsiveness of the pagination on category pages ✔️

LGTM, QA ✔️

Thanks!

@kpodemski kpodemski merged commit 76b884c into PrestaShop:develop Jul 3, 2023
@kpodemski
Copy link
Contributor

thank you @tblivet 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants