F
Filament5mo ago
Keika

Description text is same size as TextColumn

Hi, Im under the impression that a description text should be smaller than the text of the TextColumn component. Am I right? Because in my app it renders at the same size: text-sm. Am I doing something wrong?
TextColumn::make('publish_at')
->since()
->description(function(Article $article): string {
if (!$article->publish_at) {
return '';
}

if ($article->publish_at->isFuture()) {
return 'Publish on ' . $article->publish_at->format('d M Y - H:m');
}

if ($article->publish_at->isPast()) {
return 'Published on ' . $article->publish_at->format('d M Y - H:m');
}

return '';
})
TextColumn::make('publish_at')
->since()
->description(function(Article $article): string {
if (!$article->publish_at) {
return '';
}

if ($article->publish_at->isFuture()) {
return 'Publish on ' . $article->publish_at->format('d M Y - H:m');
}

if ($article->publish_at->isPast()) {
return 'Published on ' . $article->publish_at->format('d M Y - H:m');
}

return '';
})
No description
6 Replies
Dennis Koch
Dennis Koch5mo ago
It has a lighter color though. So I guess that's the intended styling for descriptions.
ericmp
ericmp5mo ago
is since fn available for Forms\Components\TextInput? or there is something similar? edit: i do something like this now:
->hint(fn (string $state): string => Carbon::make($state)->diffForHumans())
->hint(fn (string $state): string => Carbon::make($state)->diffForHumans())
Dennis Koch
Dennis Koch5mo ago
Looks good to me.
Keika
Keika5mo ago
It's just that, I hope I'm not crazy but, I clearly see it as smaller text in the docs.
No description
Keika
Keika5mo ago
And same thing in the series about Filament on Laracasts...
No description
Keika
Keika5mo ago
Im guessing it's just an illusion, as the code for it on text-column.blade.php:287 is text-sm, like for the regular text