F
Filament16mo ago
jouni.i

label weight

does anybody know better solution change specific labels to bold...? ->label(function () { return new HtmlString("<span class='font-extrabold'>".__('label name').'</span>'); }),
7 Replies
Patrick Boivin
Patrick Boivin16mo ago
This is probably the easiest way to target a single label. Otherwise you can use custom CSS if you want to target the labels for a certain type of field, etc. I can't remember if this applies to v3, but make sure to test the field validation. It's possible that you get HTML in the validation error.
awcodes
awcodes16mo ago
This should be done with css to be safe. And if you need to target a specific field you can add extra classes to it with ->extraAttribtues()
jouni.i
jouni.iOP16mo ago
Thanks for the answers, in the previous message I forgot to say that it is about the TextEntry field of the info list. For ->extraAttribtues() I don't think it's the right solution or have I misunderstood something. the red arrow in the picture points to the class font-bold set by >extraAttribtues()... which therefore goes to value not label... Like I said, I may be getting it wrong and I don't really know how to use the extraAttributes function
No description
awcodes
awcodes16mo ago
That’s a weird place for extra attributes to go. Lol. That’s not what I meant though. I said you could add a regular class, not a tailwind class to help target the element in your css file. But yea that wouldn’t work in this case.
jouni.i
jouni.iOP16mo ago
🙂 that class is only example 🙂 i understand what you mean, you mean something like this "custom-label-bold" what you think this is bug ?
awcodes
awcodes16mo ago
I would have to look at the blade file to see why it’s getting out put there. Could be a valid reason. Hard to tell with all the Lw marker crap in there.
jouni.i
jouni.iOP16mo ago
yeah.. i'm not sure how that dynamic components works.. but phpstrom search found infolists/components/text-entry.blade.php file where is it found the fi-in-text class and there extraparameters is added
No description

Did you find this page helpful?