Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vmutius's avatar

Customizing Flux Brand

Hello I use Flux UI for my webpage and now I want to increase the size of the logo.

In resources/views/flux/brand.blade.php I have this

<a href="{{ $href }}" {{ $attributes->class([$classes, 'gap-2']) }} data-flux-brand>
    <div class="size-6 rounded-sm overflow-hidden">
        <?php if (is_string($logo)): ?>
        <img src="{{ $logo }}" />
        <?php else: ?>
        {{ $logo ?? $slot }}
        <?php endif; ?>
    </div>

    <div class="text-lg text-zinc-900 font-medium truncate">{{ $name }}</div>
</a>

When I change the size-6 in the div class to size-10 I get what I want. But this is obviously not the right place to customize it.

So I added

[data-flux-brand] {
			@apply size-10;
	}

to app.css

But the behaviour is totally different.

How can I modify the size of the logo?

0 likes
1 reply
LaryAI's avatar
Level 58

Certainly! The main issue here is that the size of the logo is controlled by the class on the inner <div class="size-6 ...">, not on the [data-flux-brand] element itself. When you apply size-10 to [data-flux-brand], you’re changing the size of the entire brand link, not just the logo container.

Here’s how you can customize the logo size in a maintainable way:

1. Use a Custom CSS Class for the Logo Container

Instead of changing the Blade file directly or targeting the whole brand, add a custom class to the logo container <div>. For example:

<div class="logo-container rounded-sm overflow-hidden">

2. Define the Logo Size in Your CSS

In your app.css, add:

.logo-container {
    @apply size-10; /* Or whatever size you want */
}

3. (Optional) Make the Logo Size Configurable

If you want to make the logo size easily adjustable, you can pass a variable from your Blade component:

In your Blade file:

<div class="{{ $logoSize ?? 'size-6' }} rounded-sm overflow-hidden">

When using the component:

<x-flux.brand :logo="$logo" logoSize="size-10" ... />

Summary

  • Don’t apply size-10 to [data-flux-brand]—target the logo container instead.
  • Use a custom class or a configurable variable to control the logo size.
  • Update your CSS or Blade component accordingly.

Example:

<a href="{{ $href }}" {{ $attributes->class([$classes, 'gap-2']) }} data-flux-brand>
    <div class="logo-container rounded-sm overflow-hidden">
        <?php if (is_string($logo)): ?>
        <img src="{{ $logo }}" />
        <?php else: ?>
        {{ $logo ?? $slot }}
        <?php endif; ?>
    </div>
    <div class="text-lg text-zinc-900 font-medium truncate">{{ $name }}</div>
</a>
.logo-container {
    @apply size-10;
}

This way, you keep your customization clean and maintainable!

Please or to participate in this conversation.