Skip to content

Commit

Permalink
Use only relative font sizes (#894)
Browse files Browse the repository at this point in the history
This replaces the only use of px for font-sizes by setting up a base
rem size on the root element in a way that is easy to calculate (1 rem =
10px) and scaling up according to browser settings.
  • Loading branch information
zbrox authored and Dylan-DPC committed Oct 27, 2019
1 parent d5535d1 commit 820714a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/theme/css/chrome.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ html:not(.sidebar-visible) #menu-bar:not(:hover).folded > #menu-bar-sticky-conta
.menu-title {
display: inline-block;
font-weight: 200;
font-size: 20px;
font-size: 2rem;
line-height: var(--menu-bar-height);
text-align: center;
margin: 0;
Expand Down
7 changes: 6 additions & 1 deletion src/theme/css/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

@import 'variables.css';

:root {
/* Browser default font-size is 16px, this way 1 rem = 10px */
font-size: 62.5%;
}

html {
font-family: "Open Sans", sans-serif;
color: var(--fg);
Expand All @@ -11,7 +16,7 @@ html {

body {
margin: 0;
font-size: 1rem;
font-size: 1.6rem;
overflow-x: hidden;
}

Expand Down

0 comments on commit 820714a

Please sign in to comment.