Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Fix link styling regression introduced via #3572 (#3629)

hq15a01624f032c
diff --git a/lib/plausible_web/components/generic.ex b/lib/plausible_web/components/generic.ex
index bc595fe604..ff932fc145 100644
--- a/lib/plausible_web/components/generic.ex
+++ b/lib/plausible_web/components/generic.ex
@@ -194,14 +194,20 @@ defmodule PlausibleWeb.Components.Generic do
slot :inner_block, required: true
def dropdown_link(assigns) do
+ class =
+ "w-full inline-flex text-gray-700 dark:text-gray-300 px-3.5 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-gray-900 dark:hover:text-gray-100"
+
+ class =
+ if assigns.new_tab do
+ "#{class} justify-between"
+ else
+ class
+ end
+
+ assigns = assign(assigns, :class, class)
+
~H"""
- <.unstyled_link
- new_tab={@new_tab}
- href={@href}
- x-on:click="close()"
- class="w-full inline-flex text-gray-700 dark:text-gray-300 px-3.5 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-gray-900 dark:hover:text-gray-100"
- {@rest}
- >
+ <.unstyled_link new_tab={@new_tab} href={@href} x-on:click="close()" class={@class} {@rest}>
<%= render_slot(@inner_block) %>
</.unstyled_link>
"""
@@ -222,7 +228,7 @@ defmodule PlausibleWeb.Components.Generic do
<.link
id={@id}
class={[
- "justify-between items-center gap-x-0.5",
+ "inline-flex items-center gap-x-0.5",
@class
]}
href={@href}