Merge pull request #2109 from basecamp/theme-tweak
Apply theme preference before body renders
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<%= javascript_tag nonce: true do %>
|
||||
const theme = localStorage.getItem("theme")
|
||||
if (theme && theme !== "auto") {
|
||||
document.documentElement.dataset.theme = theme
|
||||
}
|
||||
<% end %>
|
||||
@@ -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 %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user