Skip to content

Commit 2ab46fb

Browse files
authored
Performance Profiler: match code font size in recommendations (#112371)
* Performance Profiler: match inline code font size in recommendations * fix: match inline code font size with surrounding text using inherit * fix: match code block font size with surrounding text The oversized recommendation code block came from <pre> computing to 16px while the surrounding prose is 14px; font-size: inherit on <code> copied that 16px. Give <pre> font-size: inherit so the block matches its container, the same way inline code already does.
1 parent 63c4b17 commit 2ab46fb

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

client/dashboard/sites/performance/performance-insight.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
@import "@wordpress/base-styles/variables";
22

33
.performance-insight__markdown {
4+
code {
5+
font-size: inherit;
6+
}
7+
48
pre:has(code) {
59
max-width: 100%;
10+
font-size: inherit;
611
padding: $grid-unit-20;
712
border-radius: $radius-small;
813
background-color: var( --dashboard-inline-code__background-color, #f0f0f1 );

client/performance-profiler/components/insights-section/style.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@
185185
.content {
186186
flex: 1 1 500px;
187187

188+
pre,
189+
code {
190+
font-size: inherit;
191+
}
192+
188193
&:only-child {
189194
flex: 0 1 700px;
190195
max-width: 700px; // If elements are wider, e.g. code blocks, there will be a horizontal scroll

0 commit comments

Comments
 (0)