mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
fix: Font names with spaces
This commit is contained in:
@@ -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("
|
||||
|
||||
Reference in New Issue
Block a user