diff --git a/.changeset/webframe-reserve-size-before-mount.md b/.changeset/webframe-reserve-size-before-mount.md new file mode 100644 index 000000000..c32db756c --- /dev/null +++ b/.changeset/webframe-reserve-size-before-mount.md @@ -0,0 +1,6 @@ +--- +"@gitbook/react-contentkit": patch +"gitbook": patch +--- + +Reserve the webframe's size in the server-rendered layout so anchor links to content below integration blocks no longer land too high. diff --git a/packages/gitbook/src/components/DocumentView/Integration/contentkit.css b/packages/gitbook/src/components/DocumentView/Integration/contentkit.css index ca74cba1e..dd8ff8e50 100644 --- a/packages/gitbook/src/components/DocumentView/Integration/contentkit.css +++ b/packages/gitbook/src/components/DocumentView/Integration/contentkit.css @@ -52,6 +52,14 @@ @apply relative; } +.contentkit-webframe-container { + @apply relative; +} + +.contentkit-webframe-loading { + @apply absolute inset-0 m-auto size-5 animate-spin; +} + /** Card */ .contentkit-card { @apply flex flex-col border rounded border-tint-subtle; diff --git a/packages/react-contentkit/src/ElementWebframe.tsx b/packages/react-contentkit/src/ElementWebframe.tsx index 62c31c6d3..229fe93bf 100644 --- a/packages/react-contentkit/src/ElementWebframe.tsx +++ b/packages/react-contentkit/src/ElementWebframe.tsx @@ -152,7 +152,7 @@ export function ElementWebframe(props: ContentKitClientElementProps; - } - // only use height measurement if no aspect ratio is defined const useHeightMeasurement = !aspectRatio && height; return ( -