Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/filament-dash-stack-theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@
'collapsible-navigation-groups' => false,

'breadcrumbs' => false,

/**
* Nunito Sans is the default font for the theme.
*/
'use-default-font' => true,
];
2 changes: 0 additions & 2 deletions resources/css/theme.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');
@import '/vendor/filament/filament/resources/css/theme.css';
@import 'login.css';

@config 'tailwind.config.js';

:root {
--font-family: 'Nunito Sans', sans-serif !important;
--ds-dark-bg-primary-color: #1B2431;
--ds-dark-bg-secondary-color: #273142;
--ds-dark-bg-tertiary-color: #323D4E;
Expand Down
4 changes: 4 additions & 0 deletions src/DashStackThemePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public function register(Panel $panel): void
->collapsibleNavigationGroups(config('filament-dash-stack-theme.collapsible-navigation-groups'))
->breadcrumbs(config('filament-dash-stack-theme.breadcrumbs'))
->viteTheme('vendor/nuxtifyts/dash-stack-theme/resources/css/theme.css');

if (config('filament-dash-stack-theme.use-default-font')) {
$panel->font('Nunito Sans');
}
}

public function boot(Panel $panel): void
Expand Down
25 changes: 25 additions & 0 deletions src/DashStackThemeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Nuxtifyts\DashStackTheme;

use Filament\Support\Assets\Css;
use Filament\Support\Facades\FilamentAsset;
use Illuminate\Console\Command;
use Nuxtifyts\DashStackTheme\Commands\FilamentDashStackThemeInstallCommand;
use Spatie\LaravelPackageTools\Package;
Expand All @@ -23,6 +25,29 @@ public function configurePackage(Package $package): void
->hasCommands(...self::commandsClassStrings());
}

/**
* @return $this
*/
public function boot()
{
return parent::boot()
->bootDefaultFont();
}

protected function bootDefaultFont(): static
{
if (config('filament-dash-stack-theme.use-default-font')) {
FilamentAsset::register([
Css::make(
id: 'dash-stack-theme-font',
path: 'https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap'
),
]);
}

return $this;
}

/**
* @return list<class-string<Command>>
*/
Expand Down