-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input label and badge spacing missing after upgrade #1118
Comments
@jlarm Your code works for me. Have you run |
Yep, no custom css styles are being used either. Just flux and tailwind defaults. This is a brand new app that was just started a couple of days ago. |
@jlarm Tough to help when I can't recreate it - If you can find out which CSS is causing it via your browser's dev tools, that might help. |
@jeffchown And I can confirm my CSS includes the Can you share your |
After running the tailwind upgrade everything is in the app.css file which was updated to look like this: @import 'tailwindcss';
@import '../../vendor/livewire/flux/dist/flux.css';
@plugin '@tailwindcss/forms';
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
@source '../../vendor/livewire/flux-pro/stubs/**/*.blade.php';
@source '../../vendor/livewire/flux/stubs/**/*.blade.php';
@source "../views";
@custom-variant dark (&:where(.dark, .dark *));
@layer base {
*,
::after,
::before,
::backdrop,
::file-selector-button {
border-color: var(--color-gray-200, currentColor);
}
}
@theme {
--font-sans:
Inter, ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}
/* Re-assign Flux's gray of choice... */
@theme {
--color-zinc-50: var(--color-gray-50);
--color-zinc-100: var(--color-gray-100);
--color-zinc-200: var(--color-gray-200);
--color-zinc-300: var(--color-gray-300);
--color-zinc-400: var(--color-gray-400);
--color-zinc-500: var(--color-gray-500);
--color-zinc-600: var(--color-gray-600);
--color-zinc-700: var(--color-gray-700);
--color-zinc-800: var(--color-gray-800);
--color-zinc-900: var(--color-gray-900);
--color-zinc-950: var(--color-gray-950);
}
@theme {
--color-accent: var(--color-sky-600);
--color-accent-content: var(--color-sky-600);
--color-accent-foreground: var(--color-white);
}
@layer theme {
.dark {
--color-accent: var(--color-sky-600);
--color-accent-content: var(--color-sky-400);
--color-accent-foreground: var(--color-white);
}
} |
@jlarm Do you have a I think you should be able to remove these 2 lines from your @source '../../vendor/livewire/flux-pro/stubs/**/*.blade.php';
@source '../../vendor/livewire/flux/stubs/**/*.blade.php'; then Also, did you publish any Flux views? If so, please delete them and try again. |
I don't have a tailwind.config.js file anymore. I did those steps and tried it in incognito and a different browser but still don't see the margin-bottom on the labels. |
@jlarm And you haven't previously published any of the Flux components? |
Sorry, forgot to mention that. I have not published any of the components. |
I'll have to give this one a think... |
What about your layout file? Can you post your layout and the view's blade file? |
Sure, no problem. It is a mess right now 😵💫. <!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="csrf-token" content="{{ csrf_token() }}" />
<title>{{ $title ?? config('app.name') }}</title>
<link rel="shortcut icon" type="image/x-icon" href="{{ asset('favicon.svg') }}" />
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.bunny.net" />
<link href="https://fonts.bunny.net/css?family=inter:400,500,600&display=swap" rel="stylesheet" />
<!-- Scripts -->
@vite(['resources/css/app.css', 'resources/js/app.js'])
@fluxAppearance
</head>
<body class="min-h-screen bg-white dark:bg-zinc-800">
<flux:header container class="border-b border-zinc-200 bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-900">
<flux:sidebar.toggle class="lg:hidden" icon="bars-2" inset="left" />
<x-application-logo class="mr-4 h-8 w-auto" />
<x-navigation />
<flux:spacer />
<livewire:components.date-time />
<flux:dropdown position="top" align="start">
<flux:button variant="ghost" icon-trailing="chevron-down">{{ auth()->user()->name }}</flux:button>
<flux:menu class="space-y-2">
<flux:menu.item wire:navigate href="{{ route('profile') }}" icon="user">Profile</flux:menu.item>
<flux:radio.group x-data variant="segmented" x-model="$flux.appearance">
<flux:radio value="light" icon="sun" />
<flux:radio value="dark" icon="moon" />
<flux:radio value="system" icon="computer-desktop" />
</flux:radio.group>
<flux:menu.item icon="arrow-right-start-on-rectangle">Logout</flux:menu.item>
</flux:menu>
</flux:dropdown>
</flux:header>
<flux:sidebar
stashable
sticky
class="border-r border-zinc-200 bg-zinc-50 lg:hidden dark:border-zinc-700 dark:bg-zinc-900"
>
<flux:sidebar.toggle class="lg:hidden" icon="x-mark" />
<x-navigation-mobile />
<flux:spacer />
<flux:navlist variant="outline">
<flux:navlist.item icon="cog-6-tooth" href="#">Settings</flux:navlist.item>
<flux:navlist.item icon="information-circle" href="#">Help</flux:navlist.item>
</flux:navlist>
</flux:sidebar>
<flux:main container>
<div>
<div class="flex items-end justify-between">
@if (isset($pageTitle))
<flux:heading size="lg">{{ $pageTitle }}</flux:heading>
@endif
@if (isset($actions))
{{ $actions }}
@endif
</div>
@if (isset($pageTitle))
<flux:separator class="my-5" variant="subtle" />
@endif
</div>
{{ $slot }}
</flux:main>
@persist('toast')
<flux:toast />
@endpersist
@fluxScripts
</body>
</html>
|
@jlarm And the view file? |
🤦♂️ Sorry again. There are a couple components I added from the docs that are in here just to test. Here is the view: <div>
<x-slot name="pageTitle">Create Dealership</x-slot>
<form wire:submit.prevent="save">
<div class="grid grid-cols-12 gap-5">
<div class="col-span-8">
<flux:card>
<div class="space-y-5">
<flux:field>
<flux:label badge="Required">Email</flux:label>
<flux:input type="email" required />
<flux:error name="email" />
</flux:field>
<flux:input wire:model="form.name" label="Name" badge="required" />
<flux:input wire:model="form.address" label="Address" />
<div class="grid grid-cols-3 gap-5">
<flux:input wire:model="form.city" label="City" />
<flux:select wire:model="form.state" label="State">
<flux:select.option></flux:select.option>
@foreach (App\Enum\State::cases() as $state)
<flux:select.option :value="$state->value">{{ $state->label() }}</flux:select.option>
@endforeach
</flux:select>
<flux:input wire:model="form.zipCode" label="Zip Code" />
</div>
<div class="grid grid-cols-2 gap-5">
<flux:input
mask="999-999-9999"
placeholder="999-999-9999"
wire:model="form.phone"
label="Phone Number"
/>
<flux:select wire:model="form.type" label="Type" badge="Required">
<flux:select.option></flux:select.option>
@foreach (App\Enum\Type::cases() as $type)
<flux:select.option :value="$type->value">{{ $type->label() }}</flux:select.option>
@endforeach
</flux:select>
<flux:input wire:model="form.currentSolutionName" label="Current Solution Name" />
<flux:input wire:model="form.currentSolutionUse" label="Current Solution Use" />
</div>
{{-- <flux:textarea label="Notes" rows="auto" wire:model="form.notes" placeholder="Notes..." /> --}}
<flux:editor wire:model="form.notes" label="Notes" />
</div>
</flux:card>
</div>
<div class="col-span-4">
<flux:card>
<div class="space-y-5">
<flux:fieldset>
<flux:legend>Status</flux:legend>
<flux:switch
wire:model="form.dev"
label="In Development"
description="Turn on In Development when actively working on this dealership with the Sales Dev Rep."
/>
</flux:fieldset>
<flux:separator class="my-5" variant="subtle" />
<flux:select
variant="listbox"
multiple
label="Consultants"
badge="required"
wire:model="form.selectedUsers"
>
@foreach ($this->users() as $user)
<flux:select.option :value="$user->id">{{ $user->name }}</flux:select.option>
@endforeach
</flux:select>
<flux:select label="Status" badge="required" wire:model="form.status">
<flux:select.option></flux:select.option>
@foreach (App\Enum\Status::cases() as $status)
<flux:select.option :value="$status->value">{{ $status->label() }}</flux:select.option>
@endforeach
</flux:select>
<flux:select label="Rating" badge="required" wire:model="form.rating">
<flux:select.option></flux:select.option>
@foreach (App\Enum\Rating::cases() as $rating)
<flux:select.option :value="$rating->value">{{ $rating->label() }}</flux:select.option>
@endforeach
</flux:select>
<div class="flex gap-x-2">
<flux:button type="submit" class="w-full" variant="primary">Create</flux:button>
<flux:button class="w-full">Cancel</flux:button>
</div>
</div>
</flux:card>
</div>
</div>
</form>
</div>
|
Thanks! I will try some more things on my end and if I fix it I will let you know. |
Just wanted to let you know @jlarm that I have exactly the same issue and have tried all as above. However it's just on input labels that the margin-bottom is 0px instead of 12px. See attached image. I've tested to remove everything from the layout file and just let the input be left. But the issue persists. Wtf, nvm, now a ran ![]() |
For any visual issues, always a great first try: |
@dicktornfeldt Thanks for the info! |
@jlarm i happend to have the same issue. This fixed it for me. I uninstalled Let me know if it worked for you! 👍 EDIT: I can provide some file snippets so you can compare if this doesn't solve it for you. |
@dennisfransen This really looked like the fix, unfortunately, it did not work. Some file snippets would be appreciated, thanks! |
@jlarm let me know if there is any particular file you want me to send. /* app.css */
@import "tailwindcss";
@import '../../vendor/livewire/flux/dist/flux.css';
@custom-variant dark (&:where(.dark, .dark *));
@theme {
--font-*: initial;
--font-sans: Inter, ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--color-accent: var(--color-sky-600);
--color-accent-content: var(--color-sky-600);
--color-accent-foreground: var(--color-white);
}
@layer theme {
.dark {
--color-accent: var(--color-sky-600);
--color-accent-content: var(--color-sky-400);
--color-accent-foreground: var(--color-white);
}
}
@layer base {
*,
::after,
::before,
::backdrop,
::file-selector-button {
border-color: var(--color-gray-200, currentColor);
}
}
[x-cloak] {
display: none !important;
} /*package.json*/
{
"private": true,
"type": "module",
"scripts": {
"build": "vite build",
"dev": "vite"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.0.7",
"axios": "^1.7.4",
"concurrently": "^9.0.1",
"laravel-vite-plugin": "^1.2.0",
"postcss": "^8.4.31",
"tailwindcss": "^4.0.7",
"vite": "^6.0.11"
}
} {{-- app.blade.php --}}
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=inter:400,500,600&display=swap" rel="stylesheet" />
<!-- Scripts -->
@livewireStyles
@fluxAppearance
@vite(['resources/css/app.css', 'resources/js/app.js'])
</head>
<body>
...
@livewireScripts
@fluxScripts
</body>
</html> |
@jlarm thanks for reporting! I was trying to debug this issue with @dicktornfeldt on Discord and we couldn't work out what is was, but clearing the view cache did it. I suspect this isn't a Flux issue specifically and more an issue with the Tailwind v4 upgrade and the view cache and browser cache. I'm going to leave this open for now, just so if anyone else is experiencing the issue or has a fix, can find it and comment here. |
@joshhanley Not a problem, everything else is working great. Love all you guys do for Livewire! |
Same issue 🐛 upgrade from 1.0 to 2.0 |
@jlarm and @trungpv1601 can you both try this:
Then let us know how it goes, whether it fixes the issue or not? If that doesn't work, can you then try a new component and page that only has this it it <div>
<flux:field>
<flux:label badge="Required">Email</flux:label>
<flux:input type="email" required />
<flux:error name="email" />
</flux:field>
<flux:input label="Name" badge="required" />
</div> And see if that works? If that doesn't work, can you share your latest versions of your |
I have no idea but it's working perfectly for me today. No need to delete Just follow the upgrade documents for TailwindCSS 4.0 and Flux 2.0 like yesterday. Thank you so much 🎉 |
And you're sure there is no |
@jringeisen and @jeffchown if you guys can’t work it out, I will pull the repo and have a look in the morning when I’m back on my computer, to see what I can find 🙂 |
@jringeisen And, forgive me for asking the obvious, after each of your edits, you're running |
@jringeisen Do you have a |
@jringeisen I've been deep diving a bunch of TW 4 GitHub and Stackoverflow issues... If you don't have a export default {
plugins: {
'@tailwindcss/postcss': {},
},
}; then, good old, |
No tailiwnd config file anywhere. The default laravel app has postcss so I removed it to see if that would fix it, no luck. Just re-installed it and added the postcss.config.js and ran view:clear and npm run build with no luck. |
Thanks for trying. When I removed the I'm clocking out for the evening. If I think of anything, I'll let you know. Maybe @joshhanley can work some of his magic in the morning. |
@jringeisen One last thing for the night - can you post your |
@jeffchown here you go, thanks for looking into this by the way.
|
I'm at a loss. I did a fresh install again this time ensuring I was on node v20 and still the same results. I also stopped Herd and ran the laravel app via php artisan serve, still the same issue. I also only installed Flux, not Flux Pro to see if that made a difference, nope. Anyway, Taylor Otwell is releasing the new starter kits tomorrow so I should be good to go then, just sucks that I can't get it working. |
I admit, it's strange. The OCD in me is having a tough time letting it go ;) This is my {
"private": true,
"type": "module",
"scripts": {
"build": "vite build",
"dev": "vite"
},
"devDependencies": {
+ "@tailwindcss/postcss": "^4.0.8",
"axios": "^1.7.4",
"concurrently": "^9.0.1",
"laravel-vite-plugin": "^1.2.0",
+ "postcss": "^8.4.31",
"tailwindcss": "^4.0.8",
"vite": "^6.0.11"
},
"dependencies": {
- "@tailwindcss/postcss": "^4.0.8",
"@tailwindcss/vite": "^4.0.8"
}
} Most notably is yours not having the If you're up for one last kick at the can, try matching mine (with the appropriate |
You've definitely tried everything. Here's hoping the starter kits don't suffer the same issues on your local dev. 🤞 |
@jringeisen There are similar sounding issues in this TW issue on GitHub - suggesting TW update to 4.0.8 might be contributing to the issue: tailwindlabs/tailwindcss#16733 Some people who reverted to TW 4.0.7 found relief. |
@jeffchown matched my package.json to yours, removed node_modules then reinstalled. Ran php artisan view:clear then npm run build and no luck. I also tried changing the tw version to every version before 4.0.8 and no luck. 🤷♂️ |
Wow. @jringeisen You really have tried everything. I hope we eventually get to find out what is/was causing the problem. |
@jringeisen I've just pulled your repo and everything is working as expected for me. Here is my current set up, so you can compare:
I just cloned your repo and did this:
This is what I get: ![]() My only suggestion would be to upgrade to node v22 to see if that changes anything. Considering this basic repo is working for me and @jeffchown and not you, I would be surprised if the starter packs work when they are released. |
Man, that is so crazy. I'm thinking about nuking my computer and starting all over. I just pulled the branch down and followed the steps as you laid out and still no luck. I made sure to upgrade node to v22 and ensure it was being used before installing. |
@jringeisen yeah seems crazy to me! It definitely has me curious as to what exactly is going on. #1167 seems like they're having a similar issue to you. |
@jringeisen do you have a global git ignore file? If so can you share it here? |
@jringeisen this sounds similar to your issue tailwindlabs/tailwindcss#16038 |
Ahhhhhhhhh @joshhanley that's it! I didn't know I had a global gitignore file lol. Here's the contents. When I removed everything and opened the browser the styles were loaded in. .gitignore_global
|
@jringeisen ahh haha it was the |
Thanks @joshhanley and @jeffchown for looking into this with me, man what a pain that was. |
@jringeisen no worries! Glad we got to the bottom of it! |
Damn guys... well done! 👏🔥 |
@jringeisen @joshhanley Aha! Soooo glad we have an actual answer! That's what came up when I was researching before I posted yesterday (#1118 (comment)) - Tailwind CSS will also skip scanning folders that have a .gitignore file in them. https://tailwindcss.com/docs/detecting-classes-in-source-files#which-files-are-scanned A very obscure (and lesser known) behaviour of TW4's |
@jeffchown ooops I missed that note you made yesterday! Turns out you were already on top of it 😁 Makes sense that it happens, but definitely not easy to troubleshoot |
No worries - Great minds, @joshhanley ;) Was a determined (and stubborn ;) team effort! Way to go all 👍 Definitely a tricky one to troubleshoot - especially when a fresh app is created as part of the troubleshooting! I just wanted to make sure everyone knew that even the presence of a |
Flux version
v2.0
Livewire version
v3.4
Tailwind version
v4.0.7
What is the problem?
When displaying a "Required" badge in the label for a field there is no spacing between the label and input field after the upgrade to v2.
Code snippets
How do you expect it to work?
There should be a gap between the label and the input field.
Please confirm (incomplete submissions will not be addressed)
The text was updated successfully, but these errors were encountered: