Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Docs layout component to resolve content overflow on mobile #14050

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/layouts/Docs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ import YouTube from "@/components/YouTube"
import { cn } from "@/lib/utils/cn"
import { getEditPath } from "@/lib/utils/editPath"

const baseHeadingClasses = "font-mono uppercase font-bold scroll-mt-40"
const baseHeadingClasses =
"font-mono uppercase font-bold scroll-mt-40 break-words"

const H1 = (props: HTMLAttributes<HTMLHeadingElement>) => (
<MdHeading1
Expand All @@ -56,7 +57,7 @@ const H2 = (props: HTMLAttributes<HTMLHeadingElement>) => (
/>
)

const baseSubHeadingClasses = "leading-xs font-semibold"
const baseSubHeadingClasses = "leading-xs font-semibold break-words"

const H3 = (props: HTMLAttributes<HTMLHeadingElement>) => (
<MdHeading3 className={cn(baseSubHeadingClasses, "mt-12")} {...props} />
Expand Down Expand Up @@ -145,7 +146,9 @@ export const DocsLayout = ({
maxDepth={frontmatter.sidebarDepth!}
hideEditButton={!!frontmatter.hideEditButton}
/>
{children}
<div className="prose prose-lg max-w-none break-words">
{children}
</div>
{isPageIncomplete && <CallToContribute editPath={absoluteEditPath} />}
<BackToTop />
<FeedbackCard isArticle />
Expand Down
Loading