UX: Revert #30547 UX: use em units for code font-size (#30936)

The solution in (https://github.com/discourse/discourse/pull/30547)
using `em` units was causing readability problems for code blocks in
mobile. This reverts to the previous solution
(https://github.com/discourse/discourse/pull/30536) of using `font-size:
inherit` for code within heading elements.

The downside is that the code in heading won't be slightly smaller than
the other text like it is for inline code in paragraphs, but it seems
worth it to avoid causing other size issues.
This commit is contained in:
Bryce Huhtala
2025-01-22 20:09:23 -05:00
committed by GitHub
parent 99b0ae2fc1
commit 1820dd34fc

View File

@@ -19,7 +19,7 @@ code {
color: var(--primary-very-high);
background: var(--hljs-bg);
border-radius: var(--d-border-radius);
font-size: 0.875em;
font-size: 14px;
line-height: calc((13 + 4) / 13);
}
@@ -29,6 +29,15 @@ pre > code {
max-height: 500px;
}
h1 code,
h2 code,
h3 code,
h4 code,
h5 code,
h6 code {
font-size: inherit;
}
.hljs-comment,
.hljs-doctag,
.hljs-code,