extract shared theme CSS into standalone bundle
Move the 3 theme layer imports (primitives, layer2-attributes, semantic) out of admin.css and shop.css into a new theme.css bundle loaded by all root layouts. Eliminates 28 KB of duplication on admin pages where both admin.css and shop.css were each embedding the same theme CSS. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -90,11 +90,11 @@ defmodule BerrypodWeb.ThemeCSSConsistencyTest do
|
||||
end
|
||||
|
||||
describe "CSS file structure" do
|
||||
test "admin.css imports shared theme layers" do
|
||||
css_path = Path.join([File.cwd!(), "assets", "css", "admin.css"])
|
||||
test "theme.css imports shared theme layers" do
|
||||
css_path = Path.join([File.cwd!(), "assets", "css", "theme.css"])
|
||||
css_content = File.read!(css_path)
|
||||
|
||||
# Admin imports the shared theme layers so .themed resolves all tokens
|
||||
# Theme bundle imports all three shared layers
|
||||
assert css_content =~ "theme-primitives.css"
|
||||
assert css_content =~ "theme-layer2-attributes.css"
|
||||
assert css_content =~ "theme-semantic.css"
|
||||
|
||||
Reference in New Issue
Block a user