Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Fix flashing on reapplying theme (#3760)
hq19f2f89442108
diff --git a/lib/plausible_web/components/layout.ex b/lib/plausible_web/components/layout.exindex 8dac6c784a..2665f3bef3 100644--- a/lib/plausible_web/components/layout.ex+++ b/lib/plausible_web/components/layout.ex@@ -5,7 +5,7 @@ defmodule PlausibleWeb.Components.Layout dodef theme_script(assigns) do~H"""- <script>+ <script blocking="rendering">(function(){var themePref = '<%= theme_preference(assigns) %>';function reapplyTheme() {diff --git a/lib/plausible_web/templates/layout/app.html.heex b/lib/plausible_web/templates/layout/app.html.heexindex 985251d854..ee6841c409 100644--- a/lib/plausible_web/templates/layout/app.html.heex+++ b/lib/plausible_web/templates/layout/app.html.heex@@ -25,6 +25,7 @@"Plausible · Simple, privacy-friendly alternative to Google Analytics" %></title><link rel="stylesheet" href={Routes.static_path(@conn, "/css/app.css")} />+ <PlausibleWeb.Components.Layout.theme_script {Map.take(assigns, [:current_user, :theme])} /><%= render("_tracking.html", assigns) %></head><body@@ -45,8 +46,6 @@<%= Map.get(assigns, :inner_layout) || @inner_content %></main>- <PlausibleWeb.Components.Layout.theme_script {Map.take(assigns, [:current_user, :theme])} />-<%= if assigns[:embedded] do %><div data-iframe-height></div><script type="text/javascript" src={Routes.static_path(@conn, "/js/embed.content.js")}>