Installing Filament - Laravel Mix asset's wont compile

Sorry in advance if I'm missing something straight forward... I'm on an existing laravel project and just wanted to test out FIlament Tables, I followed the documentation at: https://filamentphp.com/docs/3.x/tables/installation 1. I ran "composer require filament/tables:"^3.3" -W" 2. Since it is an existing project, I ran "php artisan filament:install --tables" 3. Next, I installed tailwind and its plugins, "npm install tailwindcss@3 @tailwindcss/forms @tailwindcss/typography postcss postcss-nesting autoprefixer --save-dev" 4. Added tailwind.config.js to root folder with contents:
import preset from './vendor/filament/support/tailwind.config.preset'

export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
}
import preset from './vendor/filament/support/tailwind.config.preset'

export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
}
5. I added tailwind layers to resources/css/app.css here are the contents of that file:
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind variants;
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind variants;
6. I created postcss.config.js in my root directory with the contents:
export default {
plugins: {
'tailwindcss/nesting': 'postcss-nesting',
tailwindcss: {},
autoprefixer: {},
},
}
export default {
plugins: {
'tailwindcss/nesting': 'postcss-nesting',
tailwindcss: {},
autoprefixer: {},
},
}
7. After all this i run
npm run dev
npm run dev
and i get this compilation error from my postcss.config.js file.
λ npm run development

> development
> mix


✖ Mix
Compiled with some errors in 4.90s

ERROR in ./resources/sass/app.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
C:\laragon\www\hsh\postcss.config.js:1
export default {
^^^^^^

SyntaxError: Unexpected token 'export'
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1048:15)
at Module._compile (node:internal/modules/cjs/loader:1083:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1173:10)
at Module.load (node:internal/modules/cjs/loader:997:32)
at Module._load (node:internal/modules/cjs/loader:838:12)
at Module.require (node:internal/modules/cjs/loader:1021:19)
at module.exports (C:\laragon\www\hsh\node_modules\import-fresh\index.js:32:59)
at loadJs (C:\laragon\www\hsh\node_modules\cosmiconfig\dist\loaders.js:16:18)
at Explorer.loadFileContent (C:\laragon\www\hsh\node_modules\cosmiconfig\dist\Explorer.js:84:32)
at processResult (C:\laragon\www\hsh\node_modules\webpack\lib\NormalModule.js:758:19)
at C:\laragon\www\hsh\node_modules\webpack\lib\NormalModule.js:860:5
at C:\laragon\www\hsh\node_modules\loader-runner\lib\LoaderRunner.js:400:11
at C:\laragon\www\hsh\node_modules\loader-runner\lib\LoaderRunner.js:252:18
at context.callback (C:\laragon\www\hsh\node_modules\loader-runner\lib\LoaderRunner.js:124:13)
at Object.loader (C:\laragon\www\hsh\node_modules\postcss-loader\dist\index.js:56:7)

1 ERROR in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)
webpack compiled with 2 errors
λ npm run development

> development
> mix


✖ Mix
Compiled with some errors in 4.90s

ERROR in ./resources/sass/app.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
C:\laragon\www\hsh\postcss.config.js:1
export default {
^^^^^^

SyntaxError: Unexpected token 'export'
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1048:15)
at Module._compile (node:internal/modules/cjs/loader:1083:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1173:10)
at Module.load (node:internal/modules/cjs/loader:997:32)
at Module._load (node:internal/modules/cjs/loader:838:12)
at Module.require (node:internal/modules/cjs/loader:1021:19)
at module.exports (C:\laragon\www\hsh\node_modules\import-fresh\index.js:32:59)
at loadJs (C:\laragon\www\hsh\node_modules\cosmiconfig\dist\loaders.js:16:18)
at Explorer.loadFileContent (C:\laragon\www\hsh\node_modules\cosmiconfig\dist\Explorer.js:84:32)
at processResult (C:\laragon\www\hsh\node_modules\webpack\lib\NormalModule.js:758:19)
at C:\laragon\www\hsh\node_modules\webpack\lib\NormalModule.js:860:5
at C:\laragon\www\hsh\node_modules\loader-runner\lib\LoaderRunner.js:400:11
at C:\laragon\www\hsh\node_modules\loader-runner\lib\LoaderRunner.js:252:18
at context.callback (C:\laragon\www\hsh\node_modules\loader-runner\lib\LoaderRunner.js:124:13)
at Object.loader (C:\laragon\www\hsh\node_modules\postcss-loader\dist\index.js:56:7)

1 ERROR in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)
webpack compiled with 2 errors
8. I did publish the assets as well, and ran "php artisan filament:upgrade" to check that, and cleared all my caches and reloaded my laragon environment. I was able to get a filament table to appear but the styles aren't compiled so there are no styles to it. I'm probably missing something with my js configs but im just not sure what.
No description
24 Replies
toeknee
toeknee7d ago
I think you are using laravel 12 and have tailwind v4 clashing
toeknee
toeknee7d ago
How to use Filament with Tailwind CSS v4
Laravel 12 ships with version 4 of Tailwind CSS, while Filament v3 only supports version 3. This guide walks you through setting up Tailwind CSS v3 alongside v4.
NotKyle
NotKyleOP7d ago
Sorry shouldve specified that, here are the versions of my packages im running: Laravel 10.48.29 composer.json
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^8.3.10",
"beyondcode/laravel-mailbox": "^4.0",
"consoletvs/charts": "^6.6",
"diglactic/laravel-breadcrumbs": "^8.1",
"filament/filament": "^3.3",
"filament/tables": "^3.3",
"guzzlehttp/guzzle": "^7.2",
"laravel-admin-ext/simplemde": "^1.0",
"laravel/fortify": "^1.24",
"laravel/framework": "^10.48",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8",
"laravel/ui": "^4.2",
"laravelcollective/html": "^6.4",
"larswiegers/laravel-maps": "^0.14",
"league/flysystem-aws-s3-v3": "^3.0",
"livewire/livewire": "^3.0",
"maatwebsite/excel": "^3.1",
"matildevoldsen/wire-comments": "^0.5.0",
"needim/noty": "^3.1",
"santigarcor/laratrust": "^7.2",
"sendgrid/sendgrid": "^8.1",
"spatie/laravel-activitylog": "^4.7",
"spatie/laravel-medialibrary": "^11.0.0",
"spatie/laravel-medialibrary-pro": "^6.0.0",
"spatie/laravel-searchable": "^1.11",
"stuk/jszip": "^3.0",
"yajra/laravel-datatables-buttons": "9.0",
"yajra/laravel-datatables-oracle": "^10.3"
},
"require-dev": {
"spatie/laravel-ignition": "^2.0",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^10.1"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi",
"@php artisan filament:upgrade"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "stable",
"prefer-stable": true,
"repositories": [
{
"type": "composer",
"url": "https://satis.spatie.be"
}
]
}
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^8.3.10",
"beyondcode/laravel-mailbox": "^4.0",
"consoletvs/charts": "^6.6",
"diglactic/laravel-breadcrumbs": "^8.1",
"filament/filament": "^3.3",
"filament/tables": "^3.3",
"guzzlehttp/guzzle": "^7.2",
"laravel-admin-ext/simplemde": "^1.0",
"laravel/fortify": "^1.24",
"laravel/framework": "^10.48",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8",
"laravel/ui": "^4.2",
"laravelcollective/html": "^6.4",
"larswiegers/laravel-maps": "^0.14",
"league/flysystem-aws-s3-v3": "^3.0",
"livewire/livewire": "^3.0",
"maatwebsite/excel": "^3.1",
"matildevoldsen/wire-comments": "^0.5.0",
"needim/noty": "^3.1",
"santigarcor/laratrust": "^7.2",
"sendgrid/sendgrid": "^8.1",
"spatie/laravel-activitylog": "^4.7",
"spatie/laravel-medialibrary": "^11.0.0",
"spatie/laravel-medialibrary-pro": "^6.0.0",
"spatie/laravel-searchable": "^1.11",
"stuk/jszip": "^3.0",
"yajra/laravel-datatables-buttons": "9.0",
"yajra/laravel-datatables-oracle": "^10.3"
},
"require-dev": {
"spatie/laravel-ignition": "^2.0",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^10.1"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi",
"@php artisan filament:upgrade"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "stable",
"prefer-stable": true,
"repositories": [
{
"type": "composer",
"url": "https://satis.spatie.be"
}
]
}
package.json
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"devDependencies": {
"@popperjs/core": "^2.10.2",
"@tailwindcss/forms": "^0.5.10",
"@tailwindcss/typography": "^0.5.16",
"autoprefixer": "^10.4.21",
"axios": "^1.6.4",
"bootstrap": "^5.3.3",
"laravel-mix": "^6.0.6",
"lodash": "^4.17.19",
"postcss": "^8.5.3",
"postcss-nesting": "^13.0.1",
"resolve-url-loader": "^5.0.0",
"sass": "^1.32.11",
"sass-loader": "^11.0.1",
"tailwindcss": "^3.4.17"
},
"dependencies": {
"chart.js": "^2.9.4",
"easymde": "^2.17.0",
"simplemde": "^1.11.2",
"tributejs": "^5.1.3"
}
}
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"devDependencies": {
"@popperjs/core": "^2.10.2",
"@tailwindcss/forms": "^0.5.10",
"@tailwindcss/typography": "^0.5.16",
"autoprefixer": "^10.4.21",
"axios": "^1.6.4",
"bootstrap": "^5.3.3",
"laravel-mix": "^6.0.6",
"lodash": "^4.17.19",
"postcss": "^8.5.3",
"postcss-nesting": "^13.0.1",
"resolve-url-loader": "^5.0.0",
"sass": "^1.32.11",
"sass-loader": "^11.0.1",
"tailwindcss": "^3.4.17"
},
"dependencies": {
"chart.js": "^2.9.4",
"easymde": "^2.17.0",
"simplemde": "^1.11.2",
"tributejs": "^5.1.3"
}
}
toeknee
toeknee7d ago
Notice it's saying the issue is in: C:\laragon\www\hsh\postcss.config.js For example this is the tailwind.config.js which works for me:
import defaultTheme from 'tailwindcss/defaultTheme';
import colors from 'tailwindcss/colors';
import forms from '@tailwindcss/forms';
import typography from '@tailwindcss/typography';

export default {
darkMode: 'class', // Deactivate dark mode for now.
content: [
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
'./vendor/laravel/**/*.blade.php',
'./vendor/laravel/**/**/*.blade.php',
'./storage/framework/views/*.php',
'./resources/views/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
import defaultTheme from 'tailwindcss/defaultTheme';
import colors from 'tailwindcss/colors';
import forms from '@tailwindcss/forms';
import typography from '@tailwindcss/typography';

export default {
darkMode: 'class', // Deactivate dark mode for now.
content: [
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
'./vendor/laravel/**/*.blade.php',
'./vendor/laravel/**/**/*.blade.php',
'./storage/framework/views/*.php',
'./resources/views/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
What you look like you are doing there is using a filament theme in the laravel root because if you create a custom theme it should please:
import preset from '../../../../vendor/filament/filament/tailwind.config.preset'

export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./app/Filament/Vessel/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./resources/views/filament/vessel/**/*.blade.php',
'./resources/views/filament/pages/*.blade.php',
'./resources/views/filament/pages/**/*.blade.php',
'./resources/views/livewire/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
'./app/Filament/**/*.php',
],
theme: {
extend: {

},
},
}
import preset from '../../../../vendor/filament/filament/tailwind.config.preset'

export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./app/Filament/Vessel/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./resources/views/filament/vessel/**/*.blade.php',
'./resources/views/filament/pages/*.blade.php',
'./resources/views/filament/pages/**/*.blade.php',
'./resources/views/livewire/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
'./app/Filament/**/*.php',
],
theme: {
extend: {

},
},
}
in resources/css/filament/app/tailwind.config.js app being the panel name
NotKyle
NotKyleOP7d ago
Sorry if I'm not fully understanding, but Im just trying to use the default themes for now, I assume that tailwind.config.js that you sent is doing that, is there anything else needed for the tailwind config other than what you showed? and both the postcss.config.js and tailwind.config.js files should be placed at the file root correct?
NotKyle
NotKyleOP7d ago
and in the created postcss.config.js file (in my root) i ONLY have the following:
export default {
plugins: {
'tailwindcss/nesting': 'postcss-nesting',
tailwindcss: {},
autoprefixer: {},
},
}
export default {
plugins: {
'tailwindcss/nesting': 'postcss-nesting',
tailwindcss: {},
autoprefixer: {},
},
}
this is what it shows in the documentation https://filamentphp.com/docs/3.x/tables/installation#! am I missing stuff for this as well?
toeknee
toeknee7d ago
Ok apologise, rushing here. That should compile but I think the issue is you are trying to include the preset that won't exist. Ypu need import preset from './vendor/filament/support/tailwind.config.preset' The present you are looking for above is for filament panels
NotKyle
NotKyleOP7d ago
So i just replaced
export default {
plugins: {
'tailwindcss/nesting': 'postcss-nesting',
tailwindcss: {},
autoprefixer: {},
},
}
export default {
plugins: {
'tailwindcss/nesting': 'postcss-nesting',
tailwindcss: {},
autoprefixer: {},
},
}
with:
module.exports = {
plugins: {
'tailwindcss/nesting': 'postcss-nesting',
tailwindcss: {},
autoprefixer: {},
},
}
module.exports = {
plugins: {
'tailwindcss/nesting': 'postcss-nesting',
tailwindcss: {},
autoprefixer: {},
},
}
In my postcss.config.js, and it successfully compiled, (which is farther than ive gotten so far) Although when reloading my page with my table component, it still doesn't render in the css.
No description
NotKyle
NotKyleOP7d ago
import preset from './vendor/filament/support/tailwind.config.preset'

export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
}
import preset from './vendor/filament/support/tailwind.config.preset'

export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
}
so this would be fine for using the general presets?
toeknee
toeknee7d ago
Yeah
NotKyle
NotKyleOP7d ago
Do you have any suggestions on how I can troubleshoot the css styles not being present now that i was able to compile all the assets? I'm not receiving any errors in dev tools, or in my laravel logs, but the styles still don't seem to be applied to my table. I also have the @FilamentStyles (in the header with livewire styles) and @FilamentScripts (in the body with my livewire scripts) in my layout file. If i look at the elements, i can see the @FilamentStyles are being registered as these 2: <link href="http://hsh.test/css/filament/forms/forms.css?v=3.3.16.0" rel="stylesheet" data-navigate-track=""> <link href="http://hsh.test/css/filament/support/support.css?v=3.3.16.0" rel="stylesheet" data-navigate-track="">
NotKyle
NotKyleOP7d ago
after some more troubleshooting, i updated my laravel mix (webpack.mix.js) to require tailwindcss through postCss, but it seems like it is overriding the sass option and removing the other styles on our page. webpack.mix.js:
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.postCss('resources/css/app.css', 'public/css', [
require('tailwindcss'),
])
.sourceMaps();
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.postCss('resources/css/app.css', 'public/css', [
require('tailwindcss'),
])
.sourceMaps();
No description
toeknee
toeknee6d ago
I suspect it's actually your custom frontend css that's messing with the styling tbh So look at your vite too? For example my vite for a custom frontend is:
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import tailwindcss from 'tailwindcss';

export default defineConfig({
https: true,
plugins: [
laravel({
hotFile: 'public/ca.hot',
buildDirectory: 'ca',
input: [
'resources/css/ca/app.css',
'resources/js/ca/app.js',
],
refresh: true,
}),
],
css: {
postcss: {
plugins: [
tailwindcss('./tailwind.ca.config.js'),
]
}
},
build: {
chunkSizeWarningLimit: 1000,
}
});
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import tailwindcss from 'tailwindcss';

export default defineConfig({
https: true,
plugins: [
laravel({
hotFile: 'public/ca.hot',
buildDirectory: 'ca',
input: [
'resources/css/ca/app.css',
'resources/js/ca/app.js',
],
refresh: true,
}),
],
css: {
postcss: {
plugins: [
tailwindcss('./tailwind.ca.config.js'),
]
}
},
build: {
chunkSizeWarningLimit: 1000,
}
});
Dennis Koch
Dennis Koch6d ago
Looks like both your SASS and your CSS file have the same name and will end up as the same file in public/css Try renaming your Filament CSS file to filament.css or similar and update your imports.
NotKyle
NotKyleOP6d ago
I tried this a little while ago, it seems like it may be an issue with some of my front end styles and the filament styles, as soon as i put this new filament/app.css in our layout, some of our elements disappear. so i believe that toeknee is right. I'm also only using mix for my css bundling.
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.postCss('resources/css/app.css', 'public/css/filament', [
require("tailwindcss"),
])
.sourceMaps();
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.postCss('resources/css/app.css', 'public/css/filament', [
require("tailwindcss"),
])
.sourceMaps();
Im going to try and remove most of our front end styles to test and see if the issue is resolved
home:92


GET http://hsh.test/css/filament/forms/forms.css?v=3.3.16.0 net::ERR_ABORTED 404 (Not Found)Understand this error
home:379


GET http://hsh.test/js/filament/notifications/notifications.js?v=3.3.16.0 net::ERR_ABORTED 404 (Not Found)Understand this error
home:390


GET http://hsh.test/js/filament/support/support.js?v=3.3.16.0 net::ERR_ABORTED 404 (Not Found)Understand this error
home:97


GET http://hsh.test/css/filament/support/support.css?v=3.3.16.0 net::ERR_ABORTED 404 (Not Found)
home:92


GET http://hsh.test/css/filament/forms/forms.css?v=3.3.16.0 net::ERR_ABORTED 404 (Not Found)Understand this error
home:379


GET http://hsh.test/js/filament/notifications/notifications.js?v=3.3.16.0 net::ERR_ABORTED 404 (Not Found)Understand this error
home:390


GET http://hsh.test/js/filament/support/support.js?v=3.3.16.0 net::ERR_ABORTED 404 (Not Found)Understand this error
home:97


GET http://hsh.test/css/filament/support/support.css?v=3.3.16.0 net::ERR_ABORTED 404 (Not Found)
🫠
Dennis Koch
Dennis Koch6d ago
Those should be published by php artisan filament:assets
NotKyle
NotKyleOP6d ago
ah yes sorry, i wanted to start fresh today so im doing a fresh install of tables, let me run that again yea that fixed the errors, thanks
NotKyle
NotKyleOP6d ago
hmmmmm it definetly is a conflict between my bootstrap styles and tailwind
No description
No description
NotKyle
NotKyleOP6d ago
i removed the 'collapsed' class and the headers for our navbar came back
Dennis Koch
Dennis Koch6d ago
Maybe some JS issues?
NotKyle
NotKyleOP6d ago
apparently its just a common naming issue with tailwind and css since they both use some of the same class names i was able to add a prefix to our tailwind styles and that seemed to fix it. tailwind.config.js
import defaultTheme from 'tailwindcss/defaultTheme';
import forms from '@tailwindcss/forms';
import preset from './vendor/filament/support/tailwind.config.preset'

/** @type {import('tailwindcss').Config} */
export default {
prefix: 'tw-',
presets: [preset],
darkMode: 'class',
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
'./storage/framework/views/*.php',
'./resources/views/**/*.blade.php',
],

theme: {
extend: {
fontFamily: {
sans: ['Figtree', ...defaultTheme.fontFamily.sans],
},
},
},

plugins: [
require('@tailwindcss/forms'),
require('@tailwindcss/typography'),
],
};
import defaultTheme from 'tailwindcss/defaultTheme';
import forms from '@tailwindcss/forms';
import preset from './vendor/filament/support/tailwind.config.preset'

/** @type {import('tailwindcss').Config} */
export default {
prefix: 'tw-',
presets: [preset],
darkMode: 'class',
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
'./storage/framework/views/*.php',
'./resources/views/**/*.blade.php',
],

theme: {
extend: {
fontFamily: {
sans: ['Figtree', ...defaultTheme.fontFamily.sans],
},
},
},

plugins: [
require('@tailwindcss/forms'),
require('@tailwindcss/typography'),
],
};
Dennis Koch
Dennis Koch6d ago
Hm, and Filament still works? Because we use them without prefix 🤔
NotKyle
NotKyleOP6d ago
Yea the table broke after adding the prefix lol
Dennis Koch
Dennis Koch6d ago
If you have CSS classes or a framework that conflicts with Tailwind, you probably can't fix this reliably. Sorry.

Did you find this page helpful?