fix theme data attributes not updating live during editing
All checks were successful
deploy / deploy (push) Successful in 1m26s

The shop_root.html.heex had duplicate .themed element with data-mood etc
attributes that were static (rendered once at page load). This prevented
live theme changes from visually updating since CSS matched the outer
stale element.

Fix: Remove data attributes from shop_root.html.heex, keeping only the
live-updated .shop-container.themed element inside the LiveView.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-03-09 20:51:59 +00:00
parent 6f0b7f4f63
commit caded6c9f8
2 changed files with 4 additions and 15 deletions

View File

@@ -26,7 +26,7 @@ defmodule BerrypodWeb.ThemeCSSConsistencyTest do
{:ok, _view, html} = live(log_in_user(conn, user), ~p"/")
# Verify themed element exists with theme data attributes
assert html =~ ~r/<div[^>]*class="themed/
assert html =~ ~r/class="[^"]*themed/
assert html =~ ~r/data-mood="/
assert html =~ ~r/data-typography="/
assert html =~ ~r/data-shape="/
@@ -39,7 +39,7 @@ defmodule BerrypodWeb.ThemeCSSConsistencyTest do
{:ok, _view, html} = live(conn, ~p"/?edit=theme")
# Verify themed element exists with theme data attributes
assert html =~ ~r/<div[^>]*class="themed/
assert html =~ ~r/class="[^"]*themed/
assert html =~ ~r/data-mood="/
assert html =~ ~r/data-typography="/
assert html =~ ~r/data-shape="/