Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanalhattami committed Apr 18, 2024
1 parent a676c65 commit a5efe86
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
2 changes: 2 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- dark mode
-
4 changes: 4 additions & 0 deletions resources/css/app.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

.context-menu-filament-action button{
@apply w-full justify-start
}
2 changes: 1 addition & 1 deletion resources/dist/app.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions resources/views/components/context-menu.blade.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
@if(method_exists(static::class, 'getContextMenu'))
<div id="contextMenu" class="flex z-50 min-w-48 max-w-2xl text-neutral-800 rounded-md border border-neutral-200/70 bg-white text-sm fixed p-2 shadow-md dark:bg-gray-950 dark:text-white dark:border-black" style="display: none;">
<div id="contextMenu" class="flex z-50 min-w-48 max-w-2xl text-neutral-800 rounded-md ring-1 ring-gray-950/5 transition bg-white text-sm fixed p-2 shadow-md dark:text-gray-200 dark:bg-gray-900 dark:ring-white/10" style="display: none;">
@foreach(static::getContextMenu()->getItems() as $item)
@if($item instanceof \Filament\Actions\Action)
<span class="flex gap-x-4 select-none group justify-between rounded px-2 py-1.5 hover:bg-neutral-100 outline-none pl-8 data-[disabled]:opacity-50 data-[disabled]:pointer-events-none dark:hover:bg-gray-100">
<span @class([
'context-menu-filament-action flex gap-x-4 select-none group justify-between rounded px-2 py-1.5 hover:bg-neutral-100 outline-none pl-8 data-[disabled]:opacity-50 data-[disabled]:pointer-events-none dark:hover:bg-white/5',
'mt-1' => !$loop->first
])>
{{ $item }}
</span>
@elseif($item instanceof \AymanAlhattami\FilamentContextMenu\ContentMenuItem)
<a href="{{ $item->getUrl() }}" target="{{ $item->getTarget() }}" @click="contextMenuOpen=false" class="flex gap-x-1 select-none group justify-between rounded px-2 py-1.5 hover:bg-neutral-100 outline-none data-[disabled]:opacity-50 data-[disabled]:pointer-events-none dark:hover:bg-gray-100">
<a href="{{ $item->getUrl() }}" target="{{ $item->getTarget() }}" @click="contextMenuOpen=false" @class([
"flex gap-x-1 select-none group justify-between rounded px-2 py-1.5 hover:bg-neutral-100 outline-none data-[disabled]:opacity-50 data-[disabled]:pointer-events-none dark:hover:bg-white/5",
'mt-1' => !$loop->first,
])>
<span class="flex gap-x-1">
@if(filled($item->getIcon()))
<span class="flex h-5 w-5 items-center justify-center">
Expand All @@ -19,7 +25,10 @@ class="h-5 w-5 ml-auto text-xs tracking-widest text-neutral-400"/>
</span>
</a>
@elseif($item instanceof \AymanAlhattami\FilamentContextMenu\ContentMenuDivider)
<div class="h-px my-1 -mx-1 bg-neutral-200"></div>
<div @class([
"flex h-px my-1 -mx-1 bg-gray-100 dark:bg-white/5",
'mt-1' => !$loop->first,
])></div>
@endif
@endforeach
</div>
Expand Down

0 comments on commit a5efe86

Please sign in to comment.