From 143cb9341d0d50c69da9900b4e721db1b66606cd Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Wed, 7 Nov 2018 12:54:18 +0100 Subject: [PATCH] Improve font rendering --- assets/_markdown.scss | 4 ++-- assets/_variables.scss | 2 +- assets/book.scss | 7 ++++++- .../book.scss_48b060fe05b0a273d182ef83c0605941.content | 2 +- .../scss/book.scss_48b060fe05b0a273d182ef83c0605941.json | 2 +- layouts/docs/baseof.html | 7 +++++-- layouts/partials/docs/html-head.html | 2 +- 7 files changed, 17 insertions(+), 9 deletions(-) diff --git a/assets/_markdown.scss b/assets/_markdown.scss index b0f7116..cb62a2f 100644 --- a/assets/_markdown.scss +++ b/assets/_markdown.scss @@ -16,7 +16,7 @@ $block-border-radius: 0.15rem; } b, optgroup, strong { - font-weight: 400; + font-weight: 700; } a { @@ -28,7 +28,7 @@ $block-border-radius: 0.15rem; } code { - font-family: 'Roboto Mono', monospace; + font-family: 'Oxygen Mono', monospace; } p code { diff --git a/assets/_variables.scss b/assets/_variables.scss index 19482f1..ced71e2 100644 --- a/assets/_variables.scss +++ b/assets/_variables.scss @@ -21,7 +21,7 @@ $gray-800: #343a40; $gray-900: #212529; $black: #000; -$color-link: #4092f1; +$color-link: #004ed0; $color-visited-link: #8440f1; $body-background: white; diff --git a/assets/book.scss b/assets/book.scss index 350fc52..56fdc9d 100644 --- a/assets/book.scss +++ b/assets/book.scss @@ -4,7 +4,7 @@ html { font-size: $font-size-base; - letter-spacing: .3px; + letter-spacing: .33px; } html, body { @@ -15,9 +15,14 @@ html, body { body { color: $body-font-color; background: $body-background; + font-family: 'Oxygen', sans-serif; font-weight: $body-font-weight; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + box-sizing: border-box; * { box-sizing: inherit; diff --git a/exampleSite/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.content b/exampleSite/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.content index 1b900e2..9e69c5e 100644 --- a/exampleSite/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.content +++ b/exampleSite/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.content @@ -1 +1 @@ -.markdown{line-height:1.7}.markdown>:first-child{margin-top:0;line-height:1em}.markdown h1,.markdown h2,.markdown h3,.markdown h4,.markdown h5{font-weight:400;line-height:1.25}.markdown b,.markdown optgroup,.markdown strong{font-weight:400}.markdown a{text-decoration:none}.markdown a:hover{text-decoration:underline}.markdown code{font-family:roboto mono,monospace}.markdown p code{padding:0 .25rem;background:#f8f9fa;border-radius:.15rem}.markdown pre{padding:1rem;background:#f8f9fa;border-radius:.15rem;font-size:.875rem;overflow-x:auto}.markdown blockquote{border-left:2px solid #dee2e6;margin:0;padding:1px 1rem}.markdown blockquote :first-child{margin-top:0}.markdown blockquote :last-child{margin-bottom:0}.markdown table tr td{padding:.5rem}html{font-size:16px;letter-spacing:.3px}html,body{min-width:25rem;overflow:hidden auto}body{color:#343a40;background:#fff;font-family:oxygen,sans-serif;font-weight:400;box-sizing:border-box}body *{box-sizing:inherit}h1,h2,h3,h4,h5{font-weight:400}a{text-decoration:none;color:#4092f1}a:visited{color:#8440f1}img{vertical-align:middle}aside ul{margin:0;padding-left:1rem;list-style:none;line-height:1.5em}aside ul li{margin:.75em 0}aside ul li a{display:block}aside ul li a:hover{opacity:.5}aside ul li img{height:1rem}aside nav>ul{padding-left:0}aside.fixed nav{position:fixed;top:0;bottom:0;overflow:hidden auto}header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;display:none}main{max-width:80rem;margin:0 auto;display:flex;flex-flow:row}main aside nav,main .content,main .markdown{transition:.2s ease-in-out;transition-property:transform,margin-left,opacity;will-change:transform,margin-left}main .menu{flex:0 0 18rem}main .menu .brand{margin-top:0}main .menu nav{width:18rem;padding:1rem;font-size:.875rem}main .menu a{color:#343a40}main .menu a.active{color:#4092f1}main .menu .flat-section{margin-bottom:1rem}main .menu .flat-section>a{font-weight:700}main .menu .flat-section>ul{padding-left:0}main .content{flex:1 0;width:0;min-width:25rem;padding:1rem}main .toc{flex:0 0 14rem}main .toc nav{width:14rem;padding:1rem;font-size:.75rem}main .toc nav ul ul{padding-left:.5rem}@media screen and (max-width:61rem){.toc{display:none}}@media screen and (max-width:43rem){.menu{margin-left:-18rem}main header{display:flex}#menu-control:checked+main .menu nav,#menu-control:checked+main .content{transform:translateX(18rem)}#menu-control:checked+main header label img{transform:rotate(90deg)}#menu-control:checked+main .markdown{opacity:.25}}@media screen and (min-width:61rem){main .content{padding:2rem 1rem}main .menu nav,main .toc nav{padding:2rem}} \ No newline at end of file +.markdown{line-height:1.7}.markdown>:first-child{margin-top:0;line-height:1em}.markdown h1,.markdown h2,.markdown h3,.markdown h4,.markdown h5{font-weight:400;line-height:1.25}.markdown b,.markdown optgroup,.markdown strong{font-weight:700}.markdown a{text-decoration:none}.markdown a:hover{text-decoration:underline}.markdown code{font-family:oxygen mono,monospace}.markdown p code{padding:0 .25rem;background:#f8f9fa;border-radius:.15rem}.markdown pre{padding:1rem;background:#f8f9fa;border-radius:.15rem;font-size:.875rem;overflow-x:auto}.markdown blockquote{border-left:2px solid #dee2e6;margin:0;padding:1px 1rem}.markdown blockquote :first-child{margin-top:0}.markdown blockquote :last-child{margin-bottom:0}.markdown table tr td{padding:.5rem}html{font-size:16px;letter-spacing:.33px}html,body{min-width:25rem;overflow:hidden auto}body{color:#343a40;background:#fff;font-family:oxygen,sans-serif;font-weight:400;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box}body *{box-sizing:inherit}h1,h2,h3,h4,h5{font-weight:400}a{text-decoration:none;color:#004ed0}a:visited{color:#8440f1}img{vertical-align:middle}aside ul{margin:0;padding-left:1rem;list-style:none;line-height:1.5em}aside ul li{margin:.75em 0}aside ul li a{display:block}aside ul li a:hover{opacity:.5}aside ul li img{height:1rem}aside nav>ul{padding-left:0}aside.fixed nav{position:fixed;top:0;bottom:0;overflow:hidden auto}header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;display:none}main{max-width:80rem;margin:0 auto;display:flex;flex-flow:row}main aside nav,main .content,main .markdown{transition:.2s ease-in-out;transition-property:transform,margin-left,opacity;will-change:transform,margin-left}main .menu{flex:0 0 18rem}main .menu .brand{margin-top:0}main .menu nav{width:18rem;padding:1rem;font-size:.875rem}main .menu a{color:#343a40}main .menu a.active{color:#004ed0}main .menu .flat-section{margin-bottom:1rem}main .menu .flat-section>a{font-weight:700}main .menu .flat-section>ul{padding-left:0}main .content{flex:1 0;width:0;min-width:25rem;padding:1rem}main .toc{flex:0 0 14rem}main .toc nav{width:14rem;padding:1rem;font-size:.75rem}main .toc nav ul ul{padding-left:.5rem}@media screen and (max-width:61rem){.toc{display:none}}@media screen and (max-width:43rem){.menu{margin-left:-18rem}main header{display:flex}#menu-control:checked+main .menu nav,#menu-control:checked+main .content{transform:translateX(18rem)}#menu-control:checked+main header label img{transform:rotate(90deg)}#menu-control:checked+main .markdown{opacity:.25}}@media screen and (min-width:61rem){main .content{padding:2rem 1rem}main .menu nav,main .toc nav{padding:2rem}} \ No newline at end of file diff --git a/exampleSite/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.json b/exampleSite/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.json index 2c152a4..a77925c 100644 --- a/exampleSite/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.json +++ b/exampleSite/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.json @@ -1 +1 @@ -{"Target":"book.min.c8c8e50ed288f167b51b63d6da0960cfaa3aa1b351c38bea4fd536d969bc1aec.css","MediaType":"text/css","Data":{"Integrity":"sha256-yMjlDtKI8We1G2PW2glgz6o6obNRw4vqT9U22Wm8Guw="}} \ No newline at end of file +{"Target":"book.min.50f271dd26ebebd6d8a9877137ff6aaf244378f21a325ced70fb19102403d4ef.css","MediaType":"text/css","Data":{"Integrity":"sha256-UPJx3Sbr69bYqYdxN/9qryRDePIaMlztcPsZECQD1O8="}} \ No newline at end of file diff --git a/layouts/docs/baseof.html b/layouts/docs/baseof.html index 30c58c0..a332fc5 100644 --- a/layouts/docs/baseof.html +++ b/layouts/docs/baseof.html @@ -1,6 +1,7 @@ {{- partial "docs/shared" -}} + {{ partial "docs/html-head" . }} {{ partial "docs/inject/head" . }} @@ -14,13 +15,13 @@ @@ -43,5 +44,7 @@ {{ partial "docs/inject/body" . }} + + \ No newline at end of file diff --git a/layouts/partials/docs/html-head.html b/layouts/partials/docs/html-head.html index 5e7b90f..f7feadb 100644 --- a/layouts/partials/docs/html-head.html +++ b/layouts/partials/docs/html-head.html @@ -2,7 +2,7 @@ {{- template "title" . }} | {{ .Site.Title -}} - + {{ $styles := resources.Get "book.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }}