@import statements fail to build with Filament v3.3.34 and Tailwind v3 - PostCSS cannot resolve vendor paths preventing custom themes #18451
Unanswered
emmanpbarrameda
asked this question in
Help
Replies: 2 comments 1 reply
-
|
up |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
up |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Package
Panel builder
Package Version
v3.3.34
How can we help you?
Problem Description:
I cannot use custom themes (including third-party themes like spykapp/filament-flat-theme) with Filament v3.3.34 because @import statements in CSS files consistently fail during the build process with PostCSS errors.
Environment:
What I'm trying to achieve:
Install and use the Filament Flat Theme package (or any custom theme) following the official Filament documentation for creating custom themes.
Steps taken:
Installed Tailwind v3 setup (removed all Tailwind v4 packages):
npm remove @tailwindcss/vite tailwindcss
npm install [email protected] @tailwindcss/[email protected] @tailwindcss/[email protected]
npm install [email protected] [email protected] [email protected]
npm install -D [email protected] [email protected]
Created postcss.config.js:
Updated resources/css/app.css to Tailwind v3 syntax:
@tailwind base;
@tailwind components;
@tailwind utilities;
php artisan make:filament-theme admin
Added theme to vite.config.js:
Updated resources/css/filament/admin/theme.css with ANY of these import attempts:
@import '/vendor/spykapp/filament-flat-theme/resources/css/theme.css';
OR
css@import '../../../../vendor/filament/filament/resources/css/base.css';
OR
css@import '../../../../vendor/filament/filament/resources/css/theme.css';
Registered in AdminPanelProvider.php:
->viteTheme('resources/css/filament/admin/theme.css')8. Ran
npm run buildError encountered:
The error occurs because:
Important INFO:
This SAME setup works perfectly in my other project:
The only difference is Filament v3.2.142 (works) vs v3.3.34 (fails).
What I've tried (all failed):
✗ Different import path formats (relative, absolute, with/without leading /)
✗ Different import orders (before/after @tailwind directives)
✗ Adding/removing @config directive
✗ Exact version matching with working project
✗ Clean node_modules reinstalls (multiple times)
✗ Different PostCSS configurations
✗ Copying vendor file to resources folder
✗ Using base.css vs theme.css from Filament
✗ Adding postcss-import filters to skip node_modules
✗ Downgrading/upgrading Vite versions
Questions:
Is this a known issue with Filament v3.3? Is there an official solution or updated documentation for creating custom themes in v3.3+?
Beta Was this translation helpful? Give feedback.
All reactions