Skip to content

Commit

Permalink
docs: fix scroll top margin (#8605)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser authored Aug 16, 2024
1 parent 5abe9f9 commit 12728f1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
5 changes: 1 addition & 4 deletions www/apps/api-reference/app/admin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@ const ReferencePage = async () => {
return (
<AreaProvider area={"admin"}>
<PageTitleProvider>
<h1 className="!text-h2 block lg:hidden">
<h1 className="!text-h2 scroll-m-56 lg:pl-4" id="introduction">
Medusa V2 Admin API Reference
</h1>
<DividedLayout
mainContent={
<Section checkActiveOnScroll={true}>
<h1 className="!text-h2 hidden lg:block">
Medusa V2 Admin API Reference
</h1>
<AdminContentV2 />
</Section>
}
Expand Down
8 changes: 2 additions & 6 deletions www/apps/api-reference/app/store/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,20 @@ const ReferencePage = async () => {
return (
<AreaProvider area={"store"}>
<PageTitleProvider>
<h1 className="!text-h2 block lg:hidden">
<h1 className="!text-h2 scroll-m-56 lg:pl-4" id="introduction">
Medusa V2 Store API Reference
</h1>
<DividedLayout
mainContent={
<Section checkActiveOnScroll={true}>
<h1 className="!text-h2 hidden lg:block">
Medusa V2 Store API Reference
</h1>
<StoreContentV2 />
</Section>
}
codeContent={
<div className="mb-1 lg:mb-0">
<div className="mb-1 lg:mb-0 hidden lg:block">
<ClientLibrariesV2 />
</div>
}
className="flex-col-reverse"
/>
<Tags />
</PageTitleProvider>
Expand Down
2 changes: 1 addition & 1 deletion www/apps/api-reference/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const config: DocsConfig = {
{
type: "link",
title: "Introduction",
path: "",
path: "introduction",
loaded: true,
},
],
Expand Down
5 changes: 3 additions & 2 deletions www/packages/docs-ui/src/components/MDXComponents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const MDXComponents: MDXComponentsType = {
<h1
className={clsx(
"h1-docs [&_code]:!h1-docs [&_code]:!font-mono mb-docs_1 text-medusa-fg-base",
props.id && "scroll-m-56",
className
)}
{...props}
Expand All @@ -47,7 +48,7 @@ export const MDXComponents: MDXComponentsType = {
<h2
className={clsx(
"h2-docs [&_code]:!h2-docs [&_code]:!font-mono mb-docs_1 mt-docs_4 text-medusa-fg-base",
props.id && "group/h2",
props.id && "group/h2 scroll-m-56",
className
)}
{...props}
Expand All @@ -73,7 +74,7 @@ export const MDXComponents: MDXComponentsType = {
<h3
className={clsx(
"h3-docs [&_code]:!h3-docs [&_code]:!font-mono mb-docs_0.5 mt-docs_3 text-medusa-fg-base",
props.id && "group/h3",
props.id && "group/h3 scroll-m-56",
className
)}
{...props}
Expand Down
7 changes: 6 additions & 1 deletion www/packages/docs-ui/src/layouts/wide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ export const WideLayout = ({
{...props}
mainWrapperClasses={clsx(props.mainWrapperClasses, "mx-auto flex")}
>
<main className="lg:max-w-wide-content relative mt-4 w-full flex-1 lg:mt-7">
<main
className={clsx(
"max-w-inner-content-xs sm:max-w-inner-content-sm md:max-w-inner-content-md",
"lg:max-w-wide-content relative mt-4 w-full flex-1 lg:mt-7"
)}
>
{children}
{showPagination && <Pagination />}
</main>
Expand Down
3 changes: 3 additions & 0 deletions www/packages/tailwind/base.tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,9 @@ module.exports = {
maximize: "maximize 500ms",
flash: "flash 1500ms 1",
},
scrollMargin: {
56: "56px",
},
},
fontFamily: {
base: [
Expand Down

0 comments on commit 12728f1

Please sign in to comment.