Add workaround for code icon being chopped off on side

Introduced by 16f08dce7f. Since the aspect
ratio of the icon isn't square, it's too wide and collides with the text
next to it. Would be nice to follow #82 and switch to a better
maintained icon pack.
This commit is contained in:
2025-07-01 02:57:55 -05:00
parent 62f0d42140
commit ca0f8d390c
2 changed files with 6 additions and 1 deletions

View File

@ -299,6 +299,11 @@ table.simple tbody tr:nth-child(even) {
vertical-align: sub;
}
/* workarounds for some icons from jam-icons being non-square aspect ratio */
.icon-code {
width: 1.25em;
}
/* }}} */

View File

@ -1,6 +1,6 @@
{{- $icon_resource := resources.Get (printf "jam/icons/%s.svg" .) -}}
{{- $icon := $icon_resource.Content -}}
{{- $icon = replaceRE `<svg` `<svg class="icon"` $icon -}}
{{- $icon = replaceRE `<svg` (printf `<svg class="icon icon-%s"` .) $icon -}}
{{- $icon = replaceRE `</svg>` (printf `<title>%s icon</title></svg>` .) $icon -}}
{{- $icon = replaceRE `(width|height)="[0-9]*"` "" $icon -}}
{{- $icon | safeHTML -}}