Skip to content

Commit

Permalink
✨ add SVG support for logos
Browse files Browse the repository at this point in the history
  • Loading branch information
ldericher committed Jul 29, 2024
1 parent e46afe4 commit 09bacd9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions assets/css/compiled/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -3163,6 +3163,13 @@ body button {
width:1em
}

/* Scale SVG logos to appropriate size */

.logo svg {
height:5rem;
width:5rem
}

/* Search */

#search-query::-webkit-search-cancel-button,
Expand Down
5 changes: 5 additions & 0 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ body button {
@apply h-[1em] w-[1em];
}

/* Scale SVG logos to appropriate size */
.logo svg {
@apply h-[5rem] w-[5rem];
}

/* Search */
#search-query::-webkit-search-cancel-button,
#search-query::-webkit-search-decoration,
Expand Down
6 changes: 6 additions & 0 deletions layouts/partials/header/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@
<a href="{{ "" | relLangURL }}" class="flex">
<span class="sr-only">{{ .Site.Title | markdownify }}</span>

{{ if eq $logo.MediaType.SubType "svg" }}
<span class="logo object-scale-down object-left nozoom">
{{ $logo.Content | safeHTML }}
</span>
{{ else }}
<img src="{{ $logo.RelPermalink }}" width="{{ div $logo.Width 2 }}" height="{{ div $logo.Height 2 }}"
class="logo max-h-[5rem] max-w-[5rem] object-scale-down object-left nozoom" alt="{{ .Site.Title }}" />
{{ end }}

</a>
</div>
Expand Down

0 comments on commit 09bacd9

Please sign in to comment.