Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Add H2 tag, add scroll margin

Terry Sutton4027ace45b29
diff --git a/apps/temp-docs/components/CustomMDX/H2.tsx b/apps/temp-docs/components/CustomMDX/H2.tsx
new file mode 100644
index 00000000000..fc1ead7380e
--- /dev/null
+++ b/apps/temp-docs/components/CustomMDX/H2.tsx
@@ -0,0 +1,17 @@
+import { getAnchor, removeAnchor } from './CustomMDX.utils'
+
+const H3 = ({ children }) => {
+ const anchor = getAnchor(children)
+ const link = `#${anchor}`
+ return (
+ <h3 id={anchor} className="group flex gap-1 items-center scroll-mt-24">
+ {removeAnchor(children)}
+ {anchor && (
+ <a href={link} className="opacity-0 group-hover:opacity-100 transition">
+ #
+ </a>
+ )}
+ </h3>
+ )
+}
+export default H3
diff --git a/apps/temp-docs/components/CustomMDX/H3.tsx b/apps/temp-docs/components/CustomMDX/H3.tsx
index e22d9b00e64..85ff9073bc9 100644
--- a/apps/temp-docs/components/CustomMDX/H3.tsx
+++ b/apps/temp-docs/components/CustomMDX/H3.tsx
@@ -1,17 +1,17 @@
import { getAnchor, removeAnchor } from './CustomMDX.utils'
-const H3 = ({ children }) => {
+const H2 = ({ children }) => {
const anchor = getAnchor(children)
const link = `#${anchor}`
return (
- <h3 id={anchor} className="group flex gap-1 items-center">
+ <h2 id={anchor} className="group flex gap-1 items-center scroll-mt-24">
{removeAnchor(children)}
{anchor && (
<a href={link} className="opacity-0 group-hover:opacity-100 transition">
#
</a>
)}
- </h3>
+ </h2>
)
}
-export default H3
+export default H2
diff --git a/apps/temp-docs/components/CustomMDX/H4.tsx b/apps/temp-docs/components/CustomMDX/H4.tsx
index 95f17286061..2c7b9723973 100644
--- a/apps/temp-docs/components/CustomMDX/H4.tsx
+++ b/apps/temp-docs/components/CustomMDX/H4.tsx
@@ -4,7 +4,7 @@ const H4 = ({ children }) => {
const anchor = getAnchor(children)
const link = `#${anchor}`
return (
- <h4 id={anchor} className="group flex gap-1 items-center">
+ <h4 id={anchor} className="group flex gap-1 items-center scroll-mt-24">
{removeAnchor(children)}
{anchor && (
<a href={link} className="opacity-0 group-hover:opacity-100 transition">
diff --git a/apps/temp-docs/components/CustomMDX/index.tsx b/apps/temp-docs/components/CustomMDX/index.tsx
index 5a537049aa3..c80de168c27 100644
--- a/apps/temp-docs/components/CustomMDX/index.tsx
+++ b/apps/temp-docs/components/CustomMDX/index.tsx
@@ -1,4 +1,5 @@
+import H2 from './H2'
import H3 from './H3'
import H4 from './H4'
-export { H3, H4 }
+export { H2, H3, H4 }
diff --git a/apps/temp-docs/components/index.tsx b/apps/temp-docs/components/index.tsx
index 9eaf671a9f9..ec11a547c66 100644
--- a/apps/temp-docs/components/index.tsx
+++ b/apps/temp-docs/components/index.tsx
@@ -4,7 +4,7 @@ import CodeBlock from './CodeBlock/CodeBlock'
import ButtonCard from './ButtonCard'
import Frameworks from './Frameworks'
import AuthProviders from './AuthProviders'
-import { H3, H4 } from './CustomMDX'
+import { H2, H3, H4 } from './CustomMDX'
const components = {
Alert: (props: any) => (
@@ -20,6 +20,7 @@ const components = {
Tabs,
TabPanel: (props: any) => <Tabs.Panel {...props}>{props.children}</Tabs.Panel>,
+ h2: H2,
h3: H3,
h4: H4,
code: (props: any) => <CodeBlock {...props} />,