Summary
On the template Docs tab (/templates/<name>/docs), only <h2> headings in the rendered README are styled. <h1>, <h3> and below render at body size and weight, so a README that starts with # Title shows the title as a plain paragraph, and ### sections are indistinguishable from the text around them.
Steps to reproduce
-
Push a template whose README.md is:
---
display_name: Example
---
# Example
Intro paragraph.
## Section
### Subsection
-
Open the template's Docs tab.
Expected
# Example is visibly larger than ## Section, which is larger than ### Subsection.
Actual
# Example and ### Subsection look like the intro paragraph. Only ## Section is rendered as a heading.
Cause
Tailwind preflight resets every heading to font-size: inherit; font-weight: inherit. site/src/index.css only restores h2 (font-size: 1.5em; font-weight: bold); h1, h3 and h4 get margins only:
https://github.com/coder/coder/blob/main/site/src/index.css#L769-L787
markdownClassName in site/src/components/Markdown/Markdown.tsx sets heading margins and line-height but no sizes either.
Suggested fix
Give the Markdown component a heading scale (for example [&_h1]:text-2xl [&_h1]:font-bold [&_h3]:text-lg [&_h3]:font-semibold, and so on), or restore sizes for every heading level in index.css next to the existing h2 rule.
Workaround
Only use h2s.
Environment
- Coder v2.37.1+22f4284
- Chrome, Linux
Summary
On the template Docs tab (
/templates/<name>/docs), only<h2>headings in the rendered README are styled.<h1>,<h3>and below render at body size and weight, so a README that starts with# Titleshows the title as a plain paragraph, and###sections are indistinguishable from the text around them.Steps to reproduce
Push a template whose README.md is:
Open the template's Docs tab.
Expected
# Exampleis visibly larger than## Section, which is larger than### Subsection.Actual
# Exampleand### Subsectionlook like the intro paragraph. Only## Sectionis rendered as a heading.Cause
Tailwind preflight resets every heading to
font-size: inherit; font-weight: inherit.site/src/index.cssonly restoresh2(font-size: 1.5em; font-weight: bold);h1,h3andh4get margins only:https://github.com/coder/coder/blob/main/site/src/index.css#L769-L787
markdownClassNameinsite/src/components/Markdown/Markdown.tsxsets heading margins and line-height but no sizes either.Suggested fix
Give the Markdown component a heading scale (for example
[&_h1]:text-2xl [&_h1]:font-bold [&_h3]:text-lg [&_h3]:font-semibold, and so on), or restore sizes for every heading level inindex.cssnext to the existingh2rule.Workaround
Only use
h2s.Environment