Skip to content

Commit fd3b38d

Browse files
Set up custom theme
1 parent dd44031 commit fd3b38d

File tree

6 files changed

+50
-1
lines changed

6 files changed

+50
-1
lines changed

Diff for: app/Providers/FilamentServiceProvider.php

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Providers;
44

55
use Filament\Facades\Filament;
6+
use Illuminate\Foundation\Vite;
67
use Filament\Navigation\UserMenuItem;
78
use Illuminate\Support\ServiceProvider;
89
use App\Filament\Resources\RoleResource;
@@ -28,6 +29,9 @@ public function register()
2829
*/
2930
public function boot() {
3031
Filament::serving(function() {
32+
Filament::registerTheme(
33+
app(Vite::class)('resources/css/filament.css'),
34+
);
3135
if (auth()->user()) {
3236
if (auth()->user()->is_admin === 1 && auth()->user()->hasAnyRole(['super-admin', 'admin', 'moderator'])) {
3337
Filament::registerUserMenuItems([

Diff for: package-lock.json

+35
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"lodash": "^4.17.19",
1515
"postcss": "^8.4.14",
1616
"tailwindcss": "^3.1.0",
17+
"tippy.js": "^6.3.7",
1718
"vite": "^3.0.0"
1819
}
1920
}

Diff for: resources/css/filament.css

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import '../../vendor/filament/filament/resources/css/app.css';

Diff for: tailwind.config.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const defaultTheme = require('tailwindcss/defaultTheme');
2+
const colors = require('tailwindcss/colors');
23

34
/** @type {import('tailwindcss').Config} */
45
module.exports = {
@@ -8,12 +9,18 @@ module.exports = {
89
'./storage/framework/views/*.php',
910
'./resources/views/**/*.blade.php',
1011
],
11-
12+
darkMode: 'class',
1213
theme: {
1314
extend: {
1415
fontFamily: {
1516
sans: ['Nunito', ...defaultTheme.fontFamily.sans],
1617
},
18+
colors: {
19+
danger: colors.rose,
20+
primary: colors.green,
21+
success: colors.blue,
22+
warning: colors.purple,
23+
},
1724
},
1825
},
1926

Diff for: vite.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export default defineConfig({
77
input: [
88
'resources/css/app.css',
99
'resources/js/app.js',
10+
'resources/css/filament.css',
1011
],
1112
refresh: [
1213
...refreshPaths,

0 commit comments

Comments
 (0)