Issue with primary color theme.

I have installed the tailwinds package, yet, I cant make my icons show blue (primary). When selecting Pending, the icon should show blue, right? All the other colors work fine...
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name'),
//Tables\Columns\TextColumn::make('is_completed'),
IconColumn::make('taskstatusName.name')
->label("Status")
->colors([
'success' => 'Done',
'warning' => 'On Hold',
'danger' => 'Cancelled',
'primary' => 'Pending'
])
->options([
'heroicon-o-x-circle',
'heroicon-o-dots-circle-horizontal' => 'On Hold',
'heroicon-o-arrow-circle-down' => 'Pending',
'heroicon-o-check-circle' => 'Done',
'heroicon-o-x-circle' => 'Cancelled',
]),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name'),
//Tables\Columns\TextColumn::make('is_completed'),
IconColumn::make('taskstatusName.name')
->label("Status")
->colors([
'success' => 'Done',
'warning' => 'On Hold',
'danger' => 'Cancelled',
'primary' => 'Pending'
])
->options([
'heroicon-o-x-circle',
'heroicon-o-dots-circle-horizontal' => 'On Hold',
'heroicon-o-arrow-circle-down' => 'Pending',
'heroicon-o-check-circle' => 'Done',
'heroicon-o-x-circle' => 'Cancelled',
]),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
43 Replies
Matthew
MatthewOP2y ago
taliwinds config:
const colors = require('tailwindcss/colors')

module.exports = {
content: [
'./resources/**/*.blade.php',
'./resources/**/*.ts',
'./resources/**/*.vue',
],
darkMode: 'class',
theme: {
extend: {
colors: {
danger: colors.rose,
primary: colors.blue,
success: colors.green,
warning: colors.yellow,
},
},
},
plugins: [
require('@tailwindcss/forms'),
require('@tailwindcss/typography'),
],
}
const colors = require('tailwindcss/colors')

module.exports = {
content: [
'./resources/**/*.blade.php',
'./resources/**/*.ts',
'./resources/**/*.vue',
],
darkMode: 'class',
theme: {
extend: {
colors: {
danger: colors.rose,
primary: colors.blue,
success: colors.green,
warning: colors.yellow,
},
},
},
plugins: [
require('@tailwindcss/forms'),
require('@tailwindcss/typography'),
],
}
Matthew
MatthewOP2y ago
The status can be selected from a dropdown (Select)
Dennis Koch
Dennis Koch2y ago
Did you follow the whole „Custom theme“ docs?
Matthew
MatthewOP2y ago
Im pretty sure I did. Im not sure what Im doing wrong
Dan Harrin
Dan Harrin2y ago
if it was set up properly, then all of the amber would be blue so this isnt exclusively an icon column issue are you registering the theme in a service provider? your tailwind config is definitely wrong - no mention of filament in the content
Dennis Koch
Dennis Koch2y ago
Check every step again.
Matthew
MatthewOP2y ago
I did, but I get this:
Dan Harrin
Dan Harrin2y ago
is this in the browser as well as the IDE?
Matthew
MatthewOP2y ago
I dont get any error in the browser
Dan Harrin
Dan Harrin2y ago
its your IDE playing up then
Matthew
MatthewOP2y ago
Matthew
MatthewOP2y ago
const colors = require('tailwindcss/colors')

module.exports = {
content: [
'./resources/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
darkMode: 'class',
theme: {
extend: {
colors: {
danger: colors.rose,
primary: colors.blue,
success: colors.green,
warning: colors.yellow,
},
},
},
plugins: [
require('@tailwindcss/forms'),
require('@tailwindcss/typography'),
],
}
const colors = require('tailwindcss/colors')

module.exports = {
content: [
'./resources/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
darkMode: 'class',
theme: {
extend: {
colors: {
danger: colors.rose,
primary: colors.blue,
success: colors.green,
warning: colors.yellow,
},
},
},
plugins: [
require('@tailwindcss/forms'),
require('@tailwindcss/typography'),
],
}
import { defineConfig } from 'vite'
import laravel from 'laravel-vite-plugin'


export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/filament.css',
],
}),
],
})
import { defineConfig } from 'vite'
import laravel from 'laravel-vite-plugin'


export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/filament.css',
],
}),
],
})
(in resources/css/filament.css)
@import '../../vendor/filament/filament/resources/css/app.css';
(in resources/css/filament.css)
@import '../../vendor/filament/filament/resources/css/app.css';
<?php

namespace App\Providers;

use Filament\Facades\Filament;
use Illuminate\Support\ServiceProvider;

class FilamentServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register()
{
//
}

/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
Filament::serving(function () {
// Using Vite
Filament::registerViteTheme('resources/css/filament.css');

// Using Laravel Mix
Filament::registerTheme(
mix('css/filament.css'),
);
});
}
}
<?php

namespace App\Providers;

use Filament\Facades\Filament;
use Illuminate\Support\ServiceProvider;

class FilamentServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register()
{
//
}

/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
Filament::serving(function () {
// Using Vite
Filament::registerViteTheme('resources/css/filament.css');

// Using Laravel Mix
Filament::registerTheme(
mix('css/filament.css'),
);
});
}
}
Dennis Koch
Dennis Koch2y ago
You did compile your theme, right?
Dan Harrin
Dan Harrin2y ago
and are you really registering the theme twice?
Matthew
MatthewOP2y ago
isnt it done automatically by laravel? How can I compile the theme? How do you mean?
Dan Harrin
Dan Harrin2y ago
read the code in boot() npm run build if you are using vite
Matthew
MatthewOP2y ago
ohh, nono, I just tested with both just to be sure. But I ran it with just Vite initially
Dan Harrin
Dan Harrin2y ago
also, did you register FilamentServiceProvider in config/app ?
Dennis Koch
Dennis Koch2y ago
No it isn’t. It’s a Tailwind thing
Matthew
MatthewOP2y ago
Ahhhhhh, yes That was the issue I didnt know that I had to do that 😅
Matthew
MatthewOP2y ago
Now it works:) Thank you
Dan Harrin
Dan Harrin2y ago
normally i would just suggest to put it in AppServiceProvider so i dont have to explain that
Dennis Koch
Dennis Koch2y ago
First test: Does my code run 🤷‍♂️😅
Matthew
MatthewOP2y ago
yes, it does 😅 Im just curious guys... how many years of experience do you have with programming/php? You have built something very robust (filament in general)
Matthew
MatthewOP2y ago
But now everything is blue
Dan Harrin
Dan Harrin2y ago
yes, blue is now the primary color
Matthew
MatthewOP2y ago
But... I changed it?
Dan Harrin
Dan Harrin2y ago
idk, probably nearly 10 to be honest if you count dabbling around with HTML and CSS and Python when I was at school recompile your theme
Matthew
MatthewOP2y ago
perfect!
Dan Harrin
Dan Harrin2y ago
you can have one primary color. yellow or blue or whatever
Matthew
MatthewOP2y ago
Well, good job 😅 Got it! Thank you
Matthew
MatthewOP2y ago
If I create a color here, then how can I use it here?
Matthew
MatthewOP2y ago
Dennis Koch
Dennis Koch2y ago
10-15 years You can’t. It’s limited to the set of colors that are predefined
Matthew
MatthewOP2y ago
Soo, I cant create my own colors?
Dennis Koch
Dennis Koch2y ago
You can’t use colors other than primary, secondary, danger, success in most places You can check the blade files to see why
Matthew
MatthewOP2y ago
One more thing. Are these called cards or something like that?
Matthew
MatthewOP2y ago
I saw it from a youtube video, and I want to build something similar
Dennis Koch
Dennis Koch2y ago
Check the demo and it’s source code Those are widgets
Dan Harrin
Dan Harrin2y ago
"stats overview widget" in v3 we are working on support for custom colors
Matthew
MatthewOP2y ago
😮 Is there a possible release window? Or is it a secret? 👀
Dan Harrin
Dan Harrin2y ago
its not a secret, we don't know ourselves. we are waiting on Livewire v3 to release before we can release our v3
martin-ro
martin-ro2y ago
There is a non-zero chance Caleb is releasing or at least announcing a release date at Laracon US 🤞
Want results from more Discord servers?
Add your server