-
Notifications
You must be signed in to change notification settings - Fork 76
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
Header CLS fixes, reduced styles and classes complexity #416
Conversation
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.
Just a small comment but not blocking as it's not really related, as it's a WIP just ping me when it's ready for review 🚀
@@ -23,7 +23,7 @@ | |||
* International Registered Trademark & Property of PrestaShop SA | |||
*} | |||
|
|||
<div id="_desktop_search" class="order-2 ms-auto"> | |||
<div id="_desktop_search" class="order-2 ms-auto col-auto px-1 hidden-on-mobile"> |
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.
We wanted to get rid of these hidden-on-*
classes but seems like we forgot to remove them, to rely more on bootstrap classes as you specified in the description
@NeOMakinG ready for CR |
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.
Seems ok to me, except a little nitpick comment but 🍬
} | ||
|
||
@include media-breakpoint-up(md) { | ||
padding: $btn-padding-y $btn-padding-x; |
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 guess we don't have any CSS variables
to consume there?
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.
Thanks @NeOMakinG for your review, changes applied.
@Oksydan Igor could you please resolve the conflicts? I will merge it after 👍 |
6a6bcd8
to
b50daf4
Compare
@Hlavtox branch rebased |
🚀🚀🚀 |
@Oksydan Could you please check the sign in button bro? The name is not hiding and chrome is applying some useragent styles, because we removed btn and btn-link classes. Thank yooooou. 🙏 |
Whoops @Hlavtox. No QA |
BLOCK__ELEMEMT__ELEMENT
to justBLOCK_EMLEMENT
.It is first part of CLS fixes for header. Also we are reducing some complexity in styles and I would like to relay more on bootstrap components instead of reinventing the wheel with some extra unneeded styles.
It will not resolve whole issue but just some part of it. It will be easier to review code, provide feedback and explain changes if we split it into multiple PR-s.
We are right now showing preview of mobile block for the js loading time, there is no longer jumping stuff around on loading on mobile devices. We will be also making preload components in next stage of CLS fixes after this one will be reviewed and merged.
Comparison (Throttling 3G FAST):
BEFORE:
before.mov
AFTER:
after.mov
There is multiple changes to header structure and we could go even further with that
header-top__right
element and children inside but I didn't want to make this PR too big. I will be harder to review and make changes according to review..hidden-on-mobile
and.hidden-on-desktop
classes has been removed and blocks got proper class replacement for that.One extra note: we shouldn't make more elements than just one in our BEM classes example:
.header__top__right
- we got here way to deep, this class has been replaced by.header-top__right
.There is a lot of example when BEM can goes wrong https://scalablecss.com/bem-nesting-grandchild-elements/