Collection of small UI Improvements closes #511 #527
1 changed files with 7 additions and 3 deletions
|
|
@ -1160,17 +1160,21 @@ defmodule MvWeb.CoreComponents do
|
|||
end
|
||||
|
||||
# Combines column class with optional sticky header classes (desktop only; theme-friendly bg).
|
||||
# hover:z-20/focus-within:z-20 lift the active header cell above sibling sticky cells (shared z-10)
|
||||
# so its hover tooltip bubble is not clipped by an adjacent opaque bg-base-100 header background.
|
||||
defp table_th_class(col, sticky_header) do
|
||||
base = Map.get(col, :class)
|
||||
sticky = if sticky_header, do: "lg:sticky lg:top-0 bg-base-100 z-10", else: nil
|
||||
sticky = if sticky_header, do: sticky_th_classes(), else: nil
|
||||
[base, sticky] |> Enum.filter(& &1) |> Enum.join(" ")
|
||||
end
|
||||
|
||||
defp table_th_sticky_class(true),
|
||||
do: "lg:sticky lg:top-0 bg-base-100 z-10"
|
||||
defp table_th_sticky_class(true), do: sticky_th_classes()
|
||||
|
||||
defp table_th_sticky_class(_), do: nil
|
||||
|
||||
defp sticky_th_classes,
|
||||
do: "lg:sticky lg:top-0 bg-base-100 z-10 hover:z-20 focus-within:z-20"
|
||||
|
||||
@doc """
|
||||
Renders a reorderable table (sortable list) with drag handle and keyboard support.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue