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

Footnotes <h2 /> is unstyled in docs theme #2097

Closed
llllvvuu opened this issue Jul 21, 2023 · 0 comments · Fixed by #2104
Closed

Footnotes <h2 /> is unstyled in docs theme #2097

llllvvuu opened this issue Jul 21, 2023 · 0 comments · Fixed by #2104

Comments

@llllvvuu
Copy link
Contributor

llllvvuu commented Jul 21, 2023

To reproduce, put this in index.mdx in the docs theme

# Testing

Footnote. [^1]

[^1]: The footnote value.

Will look like this:
Screenshot 2023-07-21 at 6 35 54 AM

Inspected element:
Screenshot 2023-07-21 at 6 37 12 AM

I think the reason this isn't a problem in the blog theme is that there, the subheading styles come from global CSS, but the docs subheadings rely on classnames (why is this? from what I can tell it is always the same):

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',

I believe the footnotes component is processed as a different component from <h2 />, so it won't be captured here:

h2: props => <HeadingLink tag="h2" context={context} {...props} />,

I can contribute a PR if let me know which is preferred:

  • Style headings in global CSS
  • Add footer section to return type of mdx-components.tsx if possible (I don't know off the top of my head if it is exposed by the mdx-js API - EDIT: it is possible but nontrivial). (Might also worth it to style some things in there besides the header - such as shrinking and dimming the text, and adding an <hr />)
@llllvvuu llllvvuu changed the title Footnotes <h2 /> is unstyled (at least in docs theme) Footnotes <h2 /> is unstyled (at least in nextra-docs-template) Jul 21, 2023
@llllvvuu llllvvuu changed the title Footnotes <h2 /> is unstyled (at least in nextra-docs-template) Footnotes <h2 /> is unstyled in docs theme Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant