Use scroll-margin-top instead of pseudo hack#30273
Conversation
|
Not working in Edge is an issue for sure. Not going to block it though, since we are talking about a small percentage anyway https://caniuse.com/#feat=mdn-css_properties_scroll-margin-top |
It just doesn't work in the old edge, caniuse is wrong here. (seems to be fixed recently, but not yet updated on production mdn/browser-compat-data#5557) |
|
I personally meant the old Edge. Like I have mentioned in the past, browsers don't magically get updated on Windows :P Also, Microsoft hasn't attempted to replace the old Edge yet, let alone that even if they do, there are so many supported Windows versions out there. Anyway, this is just a FYI, ideally we should have some kind of fallback, but even without it I guess we could try landing it later. |
|
Can't we have a fallback of some kind? |
|
@XhmikosR by using |
|
Technically, this does not work 100% since it doesn't work in all of our supported browsers. Anyway, #30273 (comment) |
|
I feel the day I can convince @XhmikosR to fully drop legacy Edge support is coming closer... |
|
Just to be sure, couldn't this be applied to sticky / fixed navbars component too? |
I recently discovered the
scroll-margin-topproperty and it turned out this was exactly what we needed instead of the hack we have. Some side notes:I've also wrapped it in a media query since the stick menu is only present above the
mdbreakpoint.