Skip to content

Commit

Permalink
fix: apply h2 styles to footnote heading, fix backlink jump
Browse files Browse the repository at this point in the history
  • Loading branch information
llllvvuu committed Jul 25, 2023
1 parent aa69c7f commit cf4d1ab
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/gorgeous-tips-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"nextra-theme-docs": patch
"nextra": patch
"docs": patch
---

fix: apply <h2/> styles to footnote heading, fix backlink jump
13 changes: 13 additions & 0 deletions packages/nextra-theme-docs/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

html {
@apply nx-antialiased nx-text-base;
scroll-padding-top: var(--nextra-navbar-height);
font-feature-settings:
'rlig' 1,
'calt' 1,
Expand Down Expand Up @@ -154,6 +155,18 @@ input[type='search'] {
}
}

.mdx-h2 {
@apply nx-mt-10 nx-border-b nx-pb-1 nx-text-3xl nx-border-neutral-200/70 contrast-more:nx-border-neutral-400 dark:nx-border-primary-100/10 contrast-more:dark:nx-border-neutral-400;
}

.footnotes > h2 {
@apply mdx-h2;
}

.footnotes a[data-footnote-backref] {
font-family: initial;
}

@keyframes nextra-fadein {
0% {
opacity: 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/nextra-theme-docs/src/mdx-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function HeadingLink({
className={cn(
'nx-font-semibold nx-tracking-tight nx-text-slate-900 dark:nx-text-slate-100',
{
h2: 'nx-mt-10 nx-border-b nx-pb-1 nx-text-3xl nx-border-neutral-200/70 contrast-more:nx-border-neutral-400 dark:nx-border-primary-100/10 contrast-more:dark:nx-border-neutral-400',
h2: 'mdx-h2',
h3: 'nx-mt-8 nx-text-2xl',
h4: 'nx-mt-8 nx-text-xl',
h5: 'nx-mt-8 nx-text-lg',
Expand Down

0 comments on commit cf4d1ab

Please sign in to comment.