fix admin font loading and theme CSS cache miss bug
add system font stack to admin reset CSS so setup/admin pages render sans-serif on all devices instead of falling through to browser default. pass path_resolver to CSSGenerator.generate on cache miss paths so font URLs resolve to digested paths in production. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e5362d56fc
commit
a78a1db847
@ -6,6 +6,7 @@
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: system-ui, -apple-system, sans-serif;
|
||||
}
|
||||
|
||||
/* Make LiveView wrapper divs transparent for layout */
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# Admin font loading
|
||||
|
||||
Status: Open — needs discussion
|
||||
Status: Complete (Option A + cache miss fix)
|
||||
|
||||
## Problem
|
||||
|
||||
|
||||
@ -114,7 +114,7 @@ defmodule BerrypodWeb.ErrorHTML do
|
||||
css
|
||||
|
||||
:miss ->
|
||||
css = CSSGenerator.generate(theme_settings)
|
||||
css = CSSGenerator.generate(theme_settings, &BerrypodWeb.Endpoint.static_path/1)
|
||||
CSSCache.put(css)
|
||||
css
|
||||
end
|
||||
|
||||
@ -138,7 +138,7 @@ defmodule BerrypodWeb.Admin.Providers.Form do
|
||||
|
||||
defp maybe_add_name(params, type, _result) do
|
||||
provider = Provider.get(type)
|
||||
Map.put_new(params, "name", provider && provider.name || type)
|
||||
Map.put_new(params, "name", (provider && provider.name) || type)
|
||||
end
|
||||
|
||||
defp encrypt_api_key(api_key) do
|
||||
|
||||
@ -27,7 +27,7 @@ defmodule BerrypodWeb.Plugs.LoadTheme do
|
||||
|
||||
:miss ->
|
||||
settings = Settings.get_theme_settings()
|
||||
css = CSSGenerator.generate(settings)
|
||||
css = CSSGenerator.generate(settings, &BerrypodWeb.Endpoint.static_path/1)
|
||||
CSSCache.put(css)
|
||||
{settings, css}
|
||||
end
|
||||
|
||||
@ -26,7 +26,7 @@ defmodule BerrypodWeb.ThemeHook do
|
||||
css
|
||||
|
||||
:miss ->
|
||||
css = CSSGenerator.generate(theme_settings)
|
||||
css = CSSGenerator.generate(theme_settings, &BerrypodWeb.Endpoint.static_path/1)
|
||||
CSSCache.put(css)
|
||||
css
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user