mirror of
https://github.com/filamentphp/filament.git
synced 2026-10-28 03:44:19 +08:00
Refactor tabs item styling
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+7
-7
File diff suppressed because one or more lines are too long
@@ -16,9 +16,13 @@
|
||||
@php
|
||||
$hasAlpineActiveClasses = filled($alpineActive);
|
||||
|
||||
$inactiveItemClasses = 'text-gray-500 hover:bg-gray-50 hover:text-gray-700 focus:bg-gray-50 focus:text-gray-700 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-gray-200 dark:focus:bg-white/5 dark:focus:text-gray-200';
|
||||
$inactiveItemClasses = 'hover:bg-gray-50 focus:bg-gray-50 dark:hover:bg-white/5 dark:focus:bg-white/5';
|
||||
|
||||
$activeItemClasses = 'fi-active fi-tabs-item-active bg-gray-50 text-primary-600 dark:bg-white/5 dark:text-primary-400';
|
||||
$activeItemClasses = 'fi-active fi-tabs-item-active bg-gray-50 dark:bg-white/5';
|
||||
|
||||
$inactiveLabelClasses = 'text-gray-500 group-hover:text-gray-700 group-focus:text-gray-700 dark:text-gray-400 dark:group-hover:text-gray-200 dark:group-focus:text-gray-200';
|
||||
|
||||
$activeLabelClasses = 'text-primary-600 dark:text-primary-400';
|
||||
|
||||
$iconClasses = 'fi-tabs-item-icon h-5 w-5';
|
||||
|
||||
@@ -44,7 +48,7 @@
|
||||
'role' => 'tab',
|
||||
])
|
||||
->class([
|
||||
'fi-tabs-item flex items-center gap-x-2 rounded-lg px-3 py-2 text-sm font-medium outline-none transition duration-75',
|
||||
'fi-tabs-item group flex items-center gap-x-2 rounded-lg px-3 py-2 text-sm font-medium outline-none transition duration-75',
|
||||
$inactiveItemClasses => (! $hasAlpineActiveClasses) && (! $active),
|
||||
$activeItemClasses => (! $hasAlpineActiveClasses) && $active,
|
||||
])
|
||||
@@ -62,7 +66,19 @@
|
||||
/>
|
||||
@endif
|
||||
|
||||
<span>
|
||||
<span
|
||||
@if ($hasAlpineActiveClasses)
|
||||
x-bind:class="{
|
||||
@js($inactiveLabelClasses): ! {{ $alpineActive }},
|
||||
@js($activeLabelClasses): {{ $alpineActive }},
|
||||
}"
|
||||
@endif
|
||||
@class([
|
||||
'fi-tabs-item-label',
|
||||
$inactiveLabelClasses => (! $hasAlpineActiveClasses) && (! $active),
|
||||
$activeLabelClasses => (! $hasAlpineActiveClasses) && $active,
|
||||
])
|
||||
>
|
||||
{{ $slot }}
|
||||
</span>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user