Skip to content

Commit

Permalink
doc: allow <code> in header elements
Browse files Browse the repository at this point in the history
Allow use of <code> in header elements without styling side effects. We
can add styling later if desired. The goal here is to allow code to be
set off in markdown without needing to escape characters and do lint
exceptions for terms. This is probably a win in terms of accessibility
too although it would be moreso if we had some visual differentiation
for <code> inside of headers. As mentioned above, that can always be
added at a later time.

Backport-PR-URL: #31109
PR-URL: #31086
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
Trott authored and BethGriggs committed Dec 31, 2019
1 parent 8f3b8ca commit 25b8fbd
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions doc/api_assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,28 @@ body {
background: #fff;
}

h1 { font-size: 2.5rem }
h2 { font-size: 2rem }
h3 { font-size: 1.75rem }
h4 { font-size: 1.5rem }
h5 { font-size: 1.25rem }
h6 { font-size: 1rem }

h1, h2, h3, h4, h5, h6 {
margin: 1.5rem 0 1rem;
text-rendering: optimizeLegibility;
h1, h1 code { font-size: 2.5rem; }
h2, h2 code { font-size: 2rem; }
h3, h3 code { font-size: 1.75rem; }
h4, h4 code { font-size: 1.5rem; }
h5, h5 code { font-size: 1.25rem; }
h6, h6 code { font-size: 1rem; }

h1, h1 code,
h2, h2 code,
h3, h3 code,
h4, h4 code,
h5, h5 code,
h6, h6 code {
background-color: inherit;
color: inherit;
font-family: inherit;
font-weight: 700;
line-height: inherit;
margin: 1.5rem 0 1rem;
padding: inherit;
position: relative;
text-rendering: optimizeLegibility;
}

pre, tt, code, .pre, span.type, a.type {
Expand Down

0 comments on commit 25b8fbd

Please sign in to comment.