From 70ad6dba5fb0b0e1b6be2dee36b62fef6bc2ab0d Mon Sep 17 00:00:00 2001 From: abdulwahabone Date: Sun, 17 Jul 2022 22:40:37 +0800 Subject: [PATCH] Improving readibility with better text styling --- src/layouts/index.css | 36 ++++++++++++++++++-- src/styles/adoc-koji.css | 3 +- src/templates/Asciidoc/components/Content.js | 5 ++- 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/layouts/index.css b/src/layouts/index.css index 0db14d2c..e3078526 100644 --- a/src/layouts/index.css +++ b/src/layouts/index.css @@ -1,11 +1,24 @@ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap'); + +:root { + --text: #111; + --link: #0074de; + --link-hover: #68b5fb; +} + body { margin: 0; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, + Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', + 'Segoe UI Symbol'; width: 100vw; height: 100vh; overflow: auto; overflow-x: hidden; - color: #111111; + color: var(--text); + font-feature-settings: 'kern'; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; } html { @@ -17,7 +30,24 @@ html { } pre { - font-family: Menlo, Monaco, "Courier New", monospace; + font-family: Menlo, Monaco, 'Courier New', monospace; border-radius: 4px; font-size: 12px; } + +p { + margin: 1.25rem 0; + color: var(--text); +} + +a { + color: var(--link); + text-decoration: none !important; +} +a:hover { + color: var(--link-hover) !important; +} + +.tip { + margin-bottom: 20px; +} diff --git a/src/styles/adoc-koji.css b/src/styles/adoc-koji.css index cbb01083..44768882 100644 --- a/src/styles/adoc-koji.css +++ b/src/styles/adoc-koji.css @@ -5,6 +5,7 @@ --bg-green-40: rgba(217, 245, 233, 0.4); /* #D9F5E9; */ --bg-red-40: rgba(253, 217, 215, 0.4); /* #FDD9D7; */ --bg-yellow-40: rgba(255, 249, 201, 0.4); /* #FFF9C9; */ + --text: #111; } /* Admonitions */ @@ -178,7 +179,7 @@ dl dd { margin-left: 2em; } dl dd:last-child, dl dd:last-child > :last-child { margin-bottom: 0; } /* Definition Lists */ -dl dt { margin-bottom: 0.3em; font-weight: bold; font-size: 16px; } +dl dt { margin-bottom: 0.3em; font-weight: bold; font-size: 16px; color: var(--text)} dl dd { margin-bottom: 0.75em; } ol > li p, ul > li p, ul dd, ol dd, .olist .olist, .ulist .ulist, .ulist .olist, .olist .ulist { margin-bottom: 0.6875em; } diff --git a/src/templates/Asciidoc/components/Content.js b/src/templates/Asciidoc/components/Content.js index 487cbe2d..e9e2494a 100644 --- a/src/templates/Asciidoc/components/Content.js +++ b/src/templates/Asciidoc/components/Content.js @@ -27,10 +27,9 @@ const Content = styled.div` } p, body { - font-size: 15px; - line-height: 21px; + font-size: 16px; + line-height: 1.65; letter-spacing: -0.32px; - color: #111111!important; } code {