fix: Font names with spaces

This commit is contained in:
Dan Harrin
2023-12-26 12:34:56 +00:00
parent 68de85c263
commit 8dfafa3486
3 changed files with 3 additions and 3 deletions
@@ -56,7 +56,7 @@
<style>
:root {
--font-family: {!! filament()->getFontFamily() !!};
--font-family: '{!! filament()->getFontFamily() !!}';
--sidebar-width: {{ filament()->getSidebarWidth() }};
--collapsed-sidebar-width: {{ filament()->getCollapsedSidebarWidth() }};
}
@@ -9,7 +9,7 @@ class BunnyFontProvider implements Contracts\FontProvider
{
public function getHtml(string $family, ?string $url = null): Htmlable
{
$family = (string) str($family)->lower()->kebab();
$family = (string) str($family)->replace(' ', '-')->lower()->kebab();
$url ??= "https://fonts.bunny.net/css?family={$family}:400,500,600,700&display=swap";
return new HtmlString("
@@ -9,7 +9,7 @@ class GoogleFontProvider implements Contracts\FontProvider
{
public function getHtml(string $family, ?string $url = null): Htmlable
{
$family = urlencode($family);
$family = str_replace(' ', '+', $family);
$url ??= "https://fonts.googleapis.com/css2?family={$family}:wght@400;500;600;700&display=swap";
return new HtmlString("