Skip to content

Commit

Permalink
Properly link small headings (vercel#74)
Browse files Browse the repository at this point in the history
This fixes vercel#68 and closes vercel#69
  • Loading branch information
leo authored and evilrabbit committed Nov 30, 2017
1 parent 8c8a4db commit 7c7fdf8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
14 changes: 14 additions & 0 deletions components/text/heading.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,17 @@ export const H4 = ({ children, isCommand }) => (
</style>
</h4>
)

export const H5 = ({ children }) => (
<h5>
{children}
<style jsx>
{`
h5 {
font-weight: bold;
font-size: 15px;
}
`}
</style>
</h5>
)
9 changes: 8 additions & 1 deletion lib/with-doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Heading from '../components/heading'
import Page from '../components/page'
import { PDIV, P, Quote } from '../components/text/paragraph'
import { UL, LI } from '../components/text/list'
import { H3, H4 } from '../components/text/heading'
import { H3, H4, H5 } from '../components/text/heading'
import { InlineCode } from '../components/text/code'
import { ExternalLink } from '../components/text/link'
import DocsNavbarDesktop from '../components/docs/navbar/desktop'
Expand Down Expand Up @@ -138,13 +138,20 @@ const DocH3 = ({ children }) => (
</Heading>
)

const DocH4 = ({ children }) => (
<Heading lean={true} offsetTop={175}>
<H5>{children}</H5>
</Heading>
)

export const components = {
p: PDIV,
strong: P.B,
ul: UL,
li: LI,
h2: DocH2,
h3: DocH3,
h4: DocH4,
code: InlineCode,
a: ExternalLink,
blockquote: Quote
Expand Down

0 comments on commit 7c7fdf8

Please sign in to comment.