F
Filament6mo ago
vas

make all tailwind classes available

Hi i have a custom infolists component which is a table and not many of the tailwind classes work like bg-gray-100 would work but if i change it to something else it wont i have created a new theme and reg like this
->viteTheme('resources/css/filament/admin/theme.css')
->viteTheme('resources/css/filament/admin/theme.css')
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js', 'resources/css/filament/app/theme.css','resources/css/filament/admin/theme.css'],
refresh: true,
}),
],
});
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js', 'resources/css/filament/app/theme.css','resources/css/filament/admin/theme.css'],
refresh: true,
}),
],
});
am i missing something ? thanks
13 Replies
DrByte
DrByte6mo ago
If you're used to using Tailwind, you know that building production assets scans your code for classes it should include, and it excludes everything else. Filament ships with all the assets that Filament implements. If you want to add more, or change some, rebuild the assets yourself, incorporating your custom components etc. EDIT: You'll need to add some more paths to your build.
vas
vas6mo ago
how can i do that i assumed creating a new theme will do it
DrByte
DrByte6mo ago
You may need to list your app namespace as additional files for it to parse You'll find this is one of the most common questions people ask. I think a search for vite or tailwind will probably reveal the answer you're looking for. awcodes often gives great answers about this topic, so look for what he's got to say in the search results you find.
vas
vas6mo ago
right ill have a look thanks
vas
vas6mo ago
thanks ill have a read
Thijmen
Thijmen6mo ago
I think one of your tailwind configs is wrong. Looks like the custom class isnt being included in the purged tailwind file Where do you put the bg-gray-100?
vas
vas6mo ago
<x-dynamic-component :component="$getEntryWrapperView()" :entry="$entry">
<div class="w-full">

<table class="min-w-full table-auto">
<thead class="bg-gray-100 dark:bg-gray-800 p-12">
<x-dynamic-component :component="$getEntryWrapperView()" :entry="$entry">
<div class="w-full">

<table class="min-w-full table-auto">
<thead class="bg-gray-100 dark:bg-gray-800 p-12">
Thijmen
Thijmen6mo ago
Did you include the blade files in the tailwind config?
vas
vas6mo ago
import preset from '../../../../vendor/filament/filament/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/filament/tailwind.config.preset'

export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
}
this is from what filament generated for the theme in css/filament/admin
Thijmen
Thijmen6mo ago
is your blade in that location?
vas
vas6mo ago
no its in infolists i just saw that now works now thanks
import preset from '../../../../vendor/filament/filament/tailwind.config.preset'

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

export default {
presets: [preset],
content: [
'./app/Filament/App/**/*.php',
'./resources/views/infolists/**/*.blade.php',
'./resources/views/filament/app/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
}
Thijmen
Thijmen6mo ago
Great!
Want results from more Discord servers?
Add your server
More Posts