Skip to content

Commit 1aed3f8

Browse files
authored
Limit logo size when css fails to load (librenms#18147)
1 parent 70bb0bf commit 1aed3f8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

resources/views/components/logo.blade.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
@if($image)
22
{{-- Include svgs inline so they can use currentColor for light/dark mode, but only if they are hosted on the same server (browser will reject it otherwise) --}}
33
@if($is_svg)
4-
<svg {{ $attributes->class(['tw:dark:text-white', 'tw:text-gray-600']) }}>
4+
<svg {{ $attributes->class(['tw:dark:text-white', 'tw:text-gray-600']) }} style="max-height: 64px">
55
<use href="{{ asset($image) }}"></use>
66
</svg>
77
@else
88
<img {{ $attributes }} src="{{ asset($image) }}" alt="{{ $text }}">
99
@endif
1010
@else
11-
<svg {{ $attributes->class(['tw:dark:text-white', 'tw:text-gray-600'])->class($responsive ? ['tw:hidden', $logo_show_class] : []) }}
11+
<svg {{ $attributes->class(['tw:dark:text-white', 'tw:text-gray-600', 'tw:max-h-64'])->class($responsive ? ['tw:hidden', $logo_show_class] : []) }}
12+
style="max-height: 64px"
1213
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 170 32.275086">
1314
<defs>
1415
<clipPath id="a">
@@ -44,7 +45,7 @@
4445
fill="#db202e"/>
4546
</svg>
4647
@if($responsive)
47-
<svg {{ $attributes->class(['tw:dark:text-white', 'tw:text-gray-600', 'tw:inline-block', $logo_hide_class]) }} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 77.558 77.558">
48+
<svg {{ $attributes->class(['tw:dark:text-white', 'tw:text-gray-600', 'tw:inline-block', $logo_hide_class]) }} style="max-height: 64px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 77.558 77.558">
4849
<path
4950
d="m43.334 26.774 7.45 7.45-2.932 2.98-7.45-7.45zM56.96 13.171l7.45 7.45-2.956 2.98-7.45-7.45zm-.48 26.774 7.498 7.45-2.956 2.98-7.691-7.45zM70.107 26.34l7.45 7.451-2.932 2.98-7.45-7.45zm-29.49-5.527 7.498-7.451 2.957 2.956-7.451 7.45zm13.17 13.17 7.451-7.45 2.98 2.932-7.45 7.45zm13.147 13.171 7.45-7.499 2.981 2.957-7.69 7.45zM26.99 34.489l7.451-7.45 2.98 2.932-7.45 7.45zm13.147 13.147 7.499-7.45 2.932 2.931-7.45 7.45zm13.17 13.17 7.451-7.498 2.98 2.956-7.498 7.69z"
5051
fill="currentColor"/>

0 commit comments

Comments
 (0)