Merge pull request #2109 from basecamp/theme-tweak

Apply theme preference before body renders
This commit is contained in:
Jason Zimdars
2025-12-12 11:48:47 -06:00
committed by GitHub
2 changed files with 7 additions and 0 deletions
@@ -0,0 +1,6 @@
<%= javascript_tag nonce: true do %>
const theme = localStorage.getItem("theme")
if (theme && theme !== "auto") {
document.documentElement.dataset.theme = theme
}
<% end %>
+1
View File
@@ -15,6 +15,7 @@
<% turbo_refreshes_with method: :morph, scroll: :preserve %>
<%= render "layouts/theme_preference" %>
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %>