Skip to content

Commit

Permalink
UI: Test content-visibility CSS features
Browse files Browse the repository at this point in the history
  • Loading branch information
fuma-nama committed Dec 22, 2024
1 parent 3445182 commit 1810868
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/spotty-poems-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fumadocs-ui': patch
---

Enable `content-visibility` CSS features
14 changes: 12 additions & 2 deletions packages/ui/src/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,18 @@ function EditOnGitHub({
export const DocsBody = forwardRef<
HTMLDivElement,
HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div ref={ref} className={cn('prose', className)} {...props} />
>((props, ref) => (
<div
ref={ref}
{...props}
className={cn('prose contain-content', props.className)}
style={
{
contentVisibility: 'auto',
...props.style,
} as object
}
/>
));

DocsBody.displayName = 'DocsBody';
Expand Down

0 comments on commit 1810868

Please sign in to comment.