File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,10 +130,17 @@ const showLoading = computed(
130130 () => docsStatus .value === ' pending' || (docsStatus .value === ' idle' && docsUrl .value !== null ),
131131)
132132const showEmptyState = computed (() => docsData .value ?.status !== ' ok' )
133+
134+ const packageHeaderHeight = usePackageHeaderHeight ()
135+ const stickyStyle = computed (() => {
136+ return {
137+ ' --combined-header-height' : ` ${56 + (packageHeaderHeight .value || 44 )}px ` ,
138+ }
139+ })
133140 </script >
134141
135142<template >
136- <div class =" docs-page flex-1 flex flex-col" >
143+ <div class =" docs-page flex-1 flex flex-col" :style = " stickyStyle " >
137144 <PackageHeader
138145 :pkg =" pkg"
139146 :resolved-version =" resolvedVersion"
@@ -193,13 +200,6 @@ const showEmptyState = computed(() => docsData.value?.status !== 'ok')
193200</template >
194201
195202<style >
196- /* Layout constants - must match AppHeader height */
197- .docs-page {
198- --app-header-height : 56px ;
199- --docs-header-height : 44px ;
200- --combined-header-height : calc (var (--app-header-height ) + var (--docs-header-height ));
201- }
202-
203203.docs-header {
204204 top : var (--app-header-height );
205205}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ defineOgImageComponent('Package', {
2828const readmeHeader = useTemplateRef (' readmeHeader' )
2929const isReadmeHeaderPinned = shallowRef (false )
3030const packageHeaderHeight = usePackageHeaderHeight ()
31- const readmeStickyTop = computed (() => ` ${56 + packageHeaderHeight .value }px ` )
31+ const readmeStickyTop = computed (() => ` ${56 + ( packageHeaderHeight .value || 44 ) }px ` )
3232
3333function isStickyPinned(el : HTMLElement | null ): boolean {
3434 if (! el ) return false
You can’t perform that action at this time.
0 commit comments