Skip to content

Commit ca82d8a

Browse files
committed
fix(theme/nav): Fixed small layout shift on scroll
When scrolling: as the nav bar transitions to having a bottom border and a blurred background, the layout of the icons would shift up slightly due to the bottom border size changing. To fix this I've made it so that the bottom border is always 1px but is transparent by default. This prevents the layout shift when scrolling.
1 parent ddd2a6c commit ca82d8a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/src/theme/components/HomeBackground/useNavTransparent.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export const useNavTransparent = () => {
3636

3737
return (
3838
<style>
39-
{'body:not(.notTopArrived) .rp-nav {background: transparent !important; border-bottom: none !important;}' +
39+
{'body:not(.notTopArrived) ' +
40+
'.rp-nav {background: transparent !important; border-bottom: 1px solid transparent !important;}' +
4041
// TODO: discussion
4142
'.rp-nav {background: color-mix(in srgb,var(--rp-c-bg) 60%,transparent);backdrop-filter: blur(25px);}'}
4243
</style>

0 commit comments

Comments
 (0)