Skip to content

Commit 25b8fbd

Browse files
TrottBethGriggs
authored andcommittedDec 31, 2019
doc: allow <code> in header elements
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 <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 8f3b8ca commit 25b8fbd

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed
 

‎doc/api_assets/style.css

+20-10
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,28 @@ body {
2020
background: #fff;
2121
}
2222

23-
h1 { font-size: 2.5rem }
24-
h2 { font-size: 2rem }
25-
h3 { font-size: 1.75rem }
26-
h4 { font-size: 1.5rem }
27-
h5 { font-size: 1.25rem }
28-
h6 { font-size: 1rem }
29-
30-
h1, h2, h3, h4, h5, h6 {
31-
margin: 1.5rem 0 1rem;
32-
text-rendering: optimizeLegibility;
23+
h1, h1 code { font-size: 2.5rem; }
24+
h2, h2 code { font-size: 2rem; }
25+
h3, h3 code { font-size: 1.75rem; }
26+
h4, h4 code { font-size: 1.5rem; }
27+
h5, h5 code { font-size: 1.25rem; }
28+
h6, h6 code { font-size: 1rem; }
29+
30+
h1, h1 code,
31+
h2, h2 code,
32+
h3, h3 code,
33+
h4, h4 code,
34+
h5, h5 code,
35+
h6, h6 code {
36+
background-color: inherit;
37+
color: inherit;
38+
font-family: inherit;
3339
font-weight: 700;
40+
line-height: inherit;
41+
margin: 1.5rem 0 1rem;
42+
padding: inherit;
3443
position: relative;
44+
text-rendering: optimizeLegibility;
3545
}
3646

3747
pre, tt, code, .pre, span.type, a.type {

0 commit comments

Comments
 (0)
Please sign in to comment.