Skip to content

Commit

Permalink
Downloads: Make font name searchable
Browse files Browse the repository at this point in the history
[why]
The download page is not searchable for font names (except in some cases
where the font is RFN or something).

Because the font name is just in the preview image (and thus an image)
users can not quickly go to some download link by searching for the
name.

[how]
Lay the font name invisible over the preview image.

Fixes: #1660

Reported-by: @willhansen
Signed-off-by: Fini Jastrow <[email protected]>
  • Loading branch information
Finii committed Jun 19, 2024
1 parent 8a55ec2 commit cff4a7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions _includes/css/nerd-font-tweaks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ p {
padding: 8px 18px;
}

.nerd-font-invisible-text {
opacity: 0.0;
}

input.nerd-font-input {
cursor: inherit;
}
Expand Down
1 change: 1 addition & 0 deletions _posts/2017-01-03-downloads.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ page: font-downloads
{% for font in site.data.fonts.fonts %}
<div class="item">
<a href="https://github.com/ryanoasis/nerd-fonts/releases/download/v{{ site.current_version }}/{{ font.folderName }}.zip" class="font-preview" style="background-image: url('/assets/img/previews/{{ font.imagePreviewFont }}.svg')">
<span class="nerd-font-invisible-text"> {{ font.patchedName }} </span>
</a>
{% assign upN = font.unpatchedName | split: " " | join: "" %}
{% assign pN = font.patchedName | split: " " | join: "" %}
Expand Down

0 comments on commit cff4a7b

Please sign in to comment.