From 47ca6fa1d21666307f245bcf44116db302786544 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Fri, 20 Mar 2026 13:02:32 +0000 Subject: [PATCH] Add canonical_tailwind to get correct formatting for tailwind classes --- .formatter.exs | 2 + .../components/add_record.ex | 14 ++-- .../components/barcode_scanner.ex | 24 +++--- .../components/chart_components.ex | 8 +- lib/music_library_web/components/chat.ex | 36 ++++----- .../components/core_components.ex | 14 ++-- lib/music_library_web/components/layouts.ex | 4 +- .../components/layouts/app.html.heex | 24 +++--- .../components/layouts/root.html.heex | 10 +-- lib/music_library_web/components/notes.ex | 8 +- .../components/pagination.ex | 4 +- .../components/record_components.ex | 80 +++++++++---------- .../components/record_form.ex | 32 ++++---- lib/music_library_web/components/release.ex | 36 ++++----- .../components/scrobble_components.ex | 20 ++--- .../components/search_components.ex | 62 +++++++------- .../components/stats_components.ex | 76 +++++++++--------- .../controllers/session_html/new.html.heex | 4 +- .../live/artist_live/form.ex | 14 ++-- .../live/artist_live/show.ex | 74 ++++++++--------- .../live/collection_live/index.ex | 6 +- .../live/collection_live/show.ex | 36 ++++----- .../live/online_store_template_live/form.ex | 10 +-- .../live/online_store_template_live/index.ex | 10 +-- .../live/record_set_live/form.ex | 2 +- .../live/record_set_live/index.ex | 48 +++++------ .../live/record_set_live/record_picker.ex | 20 ++--- .../live/record_set_live/show.ex | 28 +++---- .../live/scrobble_live/index.ex | 32 ++++---- .../live/scrobble_live/show.ex | 10 +-- .../live/scrobble_rules_live/index.ex | 24 +++--- .../live/scrobbled_tracks_live/index.ex | 26 +++--- .../live/stats_live/index.ex | 68 ++++++++-------- .../live/stats_live/top_albums.ex | 8 +- .../live/stats_live/top_artists.ex | 10 +-- .../live/stats_live/top_by_period.ex | 6 +- .../live/universal_search_live/index.ex | 4 +- .../live/wishlist_live/index.ex | 4 +- .../live/wishlist_live/show.ex | 30 +++---- mix.exs | 1 + mix.lock | 1 + 41 files changed, 467 insertions(+), 463 deletions(-) diff --git a/.formatter.exs b/.formatter.exs index 4836f716..9c7b5575 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -2,6 +2,8 @@ import_deps: [:error_tracker, :ecto, :ecto_sql, :oban, :oban_web, :phoenix, :phoenix_live_view], subdirectories: ["priv/*/migrations"], plugins: [Phoenix.LiveView.HTMLFormatter, Quokka], + attribute_formatters: %{class: CanonicalTailwind}, + canonical_tailwind: [pool_size: 2], inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"], quokka: [ only: [ diff --git a/lib/music_library_web/components/add_record.ex b/lib/music_library_web/components/add_record.ex index 4ca91022..efa8141a 100644 --- a/lib/music_library_web/components/add_record.ex +++ b/lib/music_library_web/components/add_record.ex @@ -56,7 +56,7 @@ defmodule MusicLibraryWeb.Components.AddRecord do
{gettext("No results")}
@@ -72,21 +72,21 @@ defmodule MusicLibraryWeb.Components.AddRecord do defp result(assigns) do ~H"""
  • -
    +
    {@release_group.title} ~p"/images/cover-not-found.png" <> "';"} />
    -

    +

    {@release_group.artists}

    -

    +

    {@release_group.title}

    -

    +

    {Records.Record.format_release_date(@release_group.release_date)} · {type_label( @release_group.type )} @@ -98,7 +98,7 @@ defmodule MusicLibraryWeb.Components.AddRecord do {gettext("Choose which format to import")} <.icon name="hero-plus" - class="h-5 w-5 text-zinc-500 dark:text-zinc-400 cursor-pointer" + class="size-5 cursor-pointer text-zinc-500 dark:text-zinc-400" aria-hidden="true" data-slot="icon" /> diff --git a/lib/music_library_web/components/barcode_scanner.ex b/lib/music_library_web/components/barcode_scanner.ex index 07dc8be2..95beb8b8 100644 --- a/lib/music_library_web/components/barcode_scanner.ex +++ b/lib/music_library_web/components/barcode_scanner.ex @@ -22,16 +22,16 @@ defmodule MusicLibraryWeb.Components.BarcodeScanner do ~H"""

    -

    +

    {gettext("Scan one or more barcodes")}

    <.camera_button camera={@camera} /> -
    -