Skip to content

Commit af355d3

Browse files
authored
EUI font-size compatibility (#2011)
* EUI font-size compatibility * Run prettier * Add comments * Run prettier
1 parent 68342ce commit af355d3

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/Elastic.Documentation.Site/Assets/styles.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@
2424
@import './api-docs.css';
2525
@import 'tippy.js/dist/tippy.css';
2626

27+
html {
28+
/* We need to use 14px because EUI works best with a 14px base */
29+
font-size: 14px;
30+
}
31+
32+
body {
33+
/* This is still needed because of some usages of ch units and to maintain the previous behavior */
34+
font-size: 16px;
35+
}
36+
2737
:root {
2838
--outline-size: max(2px, 0.08em);
2939
--outline-style: auto;

src/Elastic.Documentation.Site/Assets/theme.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,14 @@
175175
--color-poppy: #fa744e; /* == --color-poppy-90 */
176176

177177
--spacing: 4px;
178+
179+
/* Typography scale based on a 14px base but to maintain the behaviour of 16px */
180+
--text-xs: 0.857rem; /* 12px */
181+
--text-sm: 1rem; /* 14px */
182+
--text-base: 1.143rem; /* 16px */
183+
--text-xl: 1.429rem; /* 20px */
184+
--text-2xl: 1.714rem; /* 24px */
185+
--text-3xl: 2.143rem; /* 30px */
186+
--text-4xl: 2.571rem; /* 36px */
187+
--text-5xl: 3.429rem; /* 48px */
178188
}

src/Elastic.Documentation.Site/Assets/web-components/VersionDropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ const VersionDropdown = ({
197197
<EuiText
198198
css={css`
199199
font-weight: ${euiTheme.font.weight.bold};
200-
font-size: ${useEuiFontSize('xs').fontSize};
200+
font-size: ${useEuiFontSize('s').fontSize};
201201
`}
202202
>
203203
Current version ({currentVersion})

0 commit comments

Comments
 (0)