From 821a8e223cc6a0bb3acc71f79fec61410a9827a6 Mon Sep 17 00:00:00 2001 From: shibao Date: Thu, 17 Nov 2022 22:24:28 -0500 Subject: [PATCH] tweak styling --- assets/css/components.scss | 5 ++--- lib/memex_web/components/table_component.ex | 4 ++-- lib/memex_web/components/table_component.html.heex | 14 +++++++------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/assets/css/components.scss b/assets/css/components.scss index b5c3a21..b358d96 100644 --- a/assets/css/components.scss +++ b/assets/css/components.scss @@ -7,7 +7,7 @@ .input-primary { @apply bg-primary-900; - @apply border-primary-600 hover:border-primary-500 active:border-primary-400; + @apply border-primary-900 hover:border-primary-800 active:border-primary-700; @apply text-primary-400; } @@ -34,7 +34,7 @@ .btn-primary { @apply bg-primary-900 focus:bg-primary-900 active:bg-primary-800; - @apply border-primary-600 hover:border-primary-500 active:border-primary-400; + @apply border-primary-900 hover:border-primary-800 active:border-primary-700; @apply text-primary-400; } @@ -59,7 +59,6 @@ .alert { @apply bg-primary-900; - @apply border-primary-600 hover:border-primary-500 active:border-primary-400; @apply text-primary-400; padding: 15px; margin-bottom: 20px; diff --git a/lib/memex_web/components/table_component.ex b/lib/memex_web/components/table_component.ex index 16fe3c5..b1babfe 100644 --- a/lib/memex_web/components/table_component.ex +++ b/lib/memex_web/components/table_component.ex @@ -71,8 +71,8 @@ defmodule MemexWeb.Components.TableComponent do last_sort_key: initial_key, sort_mode: initial_sort_mode ) - |> assign_new(:row_class, fn -> "bg-white" end) - |> assign_new(:alternate_row_class, fn -> "bg-gray-200" end) + |> assign_new(:row_class, fn -> "bg-primary-900" end) + |> assign_new(:alternate_row_class, fn -> "bg-primary-900" end) {:ok, socket} end diff --git a/lib/memex_web/components/table_component.html.heex b/lib/memex_web/components/table_component.html.heex index bd91298..742df2a 100644 --- a/lib/memex_web/components/table_component.html.heex +++ b/lib/memex_web/components/table_component.html.heex @@ -1,6 +1,6 @@ -
- - +
+
+ <%= for %{key: key, label: label} = column <- @columns do %> <%= if column |> Map.get(:sortable, true) do %> @@ -11,16 +11,16 @@ phx-value-sort-key={key} phx-target={@myself} > - <%= label %> + <%= label %> <%= if @last_sort_key == key do %> <%= case @sort_mode do %> <% :asc -> %> - + <% :desc -> %> - + <% end %> <% else %> - + <% end %>