From 8f79ba5bf4ea54a539ec7769c62de86d54c1bcd7 Mon Sep 17 00:00:00 2001 From: Ryan L McIntyre Date: Sat, 5 Dec 2020 02:25:00 -0800 Subject: [PATCH] Improves download page DOM rendering perf * refactored and simplified DOM elements --- _includes/css/nerd-font-tweaks.scss | 57 ++++++++++++++++++++++++----- _posts/2017-01-03-downloads.md | 22 +++-------- font-downloads.html | 18 ++++----- 3 files changed, 62 insertions(+), 35 deletions(-) diff --git a/_includes/css/nerd-font-tweaks.scss b/_includes/css/nerd-font-tweaks.scss index 622f2f8c4..733f6bec2 100644 --- a/_includes/css/nerd-font-tweaks.scss +++ b/_includes/css/nerd-font-tweaks.scss @@ -15,6 +15,25 @@ p { color: inherit; } +a.nerd-font-button { + font-size: 21px; + text-decoration: none; +} + +a.nerd-font-button:before { + font-weight: normal; + margin-right: .25em; + /* .nf */ + font-family: 'NerdFontsSymbols Nerd Font'; + font-style: normal; + font-weight: 400; + font-variant: normal; + text-transform: none; + line-height: 1; + -webkit-font-smoothing: antialiased; +} + + #main .nerd-font-badges { line-height: 2.3em; } @@ -426,8 +445,13 @@ p { padding: 10px; margin: 10px; display: flex; - flex-direction: column; - justify-content: space-between; + flex-direction: column; + justify-content: space-between; + + // max-width: 600px; + // min-width: 400px; + width: 595px; + .download-icon { content: ""; font-size: 32px; @@ -438,20 +462,35 @@ p { padding-right: 10px; padding-top: 5px; } - >a:first-of-type { - text-decoration: none; - } img { vertical-align: top !important; } + .font-preview { + text-decoration: none; + background-size: contain; + height: 110px; + background-repeat: no-repeat; + background-position-x: 34px; + } + .font-preview:before { + content: ""; + font-size: 32px; + font-family: 'NerdFontsSymbols Nerd Font'; + } + } + .nerd-font-buttons-wrapper { + display: flex; + flex-wrap: wrap; + } + .button-empty-spacer { + height: 42px; + width: 100%; } .nerd-font-button { border-width: 2px; border-style: solid; - span { - font-size: 14px; - line-height: 14px; - } + flex-shrink: 1; + flex-grow: 1; } } diff --git a/_posts/2017-01-03-downloads.md b/_posts/2017-01-03-downloads.md index d900de501..8b54a71a2 100644 --- a/_posts/2017-01-03-downloads.md +++ b/_posts/2017-01-03-downloads.md @@ -12,24 +12,14 @@ page: font-downloads
{% for font in site.data.fonts.fonts %}
- -
- {{ font.unpatchedName }} +
-
    - {% if font.unpatchedName != font.patchedName %}
  • Reserved Font Name: {{ font.unpatchedName }}
  • {% endif %} -
  • Info: {{ font.description }}
  • -
-
-

- - Download -

+ {% if font.unpatchedName != font.patchedName %}
• Reserved Font Name: {{ font.unpatchedName }}
{% endif %} +
• Info: {{ font.description }}
+
+ Download {% if font.linkPreviewFont != false %} -

- - Preview on ProgrammingFonts.org -

+ Preview on ProgrammingFonts.org {% endif %}
diff --git a/font-downloads.html b/font-downloads.html index d6e5caa87..5fed67354 100755 --- a/font-downloads.html +++ b/font-downloads.html @@ -3,16 +3,14 @@ {% include header.html %} - -
- {% assign page = site.posts[3] %} - {% include topnav.html %} - {% include section.html %} -