Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix FOUC by moving stylesheets to head #686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
justin808 merged 5 commits into master from fix-fouc
Oct 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some comments aren't visible on the classic Files Changed page.

30 changes: 16 additions & 14 deletions app/views/layouts/application.html.erb
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
<% content_for :body_content do %>
<%= react_component "NavigationBarApp" %>

<div class="container mx-auto px-4 flex-grow">
<%= yield %>
</div>

<%= react_component "Footer" %>

<!-- This is a placeholder for ReactOnRails to know where to render the store props for
client side hydration -->
<%= redux_store_hydration_data %>
<% end %>
<!DOCTYPE html>
<html>
<head>
Expand All @@ -8,23 +21,12 @@
<%= append_stylesheet_pack_tag('stimulus-bundle') %>
<%= append_javascript_pack_tag('stimulus-bundle') %>
<%= append_javascript_pack_tag('stores-registration') %>
<%= stylesheet_pack_tag(media: 'all', 'data-turbolinks-track': true) %>
<%= javascript_pack_tag('data-turbolinks-track': true, defer: true) %>

<%= csrf_meta_tags %>
</head>
<body class="min-h-screen flex flex-col bg-sky-50 text-gray-700">
<%= react_component "NavigationBarApp" %>

<div class="container mx-auto px-4 flex-grow">
<%= yield %>
</div>

<%= react_component "Footer" %>

<%= stylesheet_pack_tag(media: 'all', 'data-turbolinks-track': true) %>
<%= javascript_pack_tag('data-turbolinks-track': true, defer: true) %>

<!-- This is a placeholder for ReactOnRails to know where to render the store props for
client side hydration -->
<%= redux_store_hydration_data %>
<%= yield :body_content %>
</body>
</html>
22 changes: 12 additions & 10 deletions app/views/layouts/stimulus_layout.html.erb
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<% content_for :body_content do %>
<%= react_component "NavigationBarApp" %>

<div class="container mx-auto px-4 flex-grow">
<%= yield %>
</div>

<%= react_component "Footer" %>
<% end %>
<!DOCTYPE html>
<html>
<head>
Expand All @@ -7,20 +16,13 @@

<%= append_stylesheet_pack_tag('stimulus-bundle') %>
<%= append_javascript_pack_tag('stimulus-bundle') %>
<%= stylesheet_pack_tag(media: 'all', 'data-turbolinks-track': true) %>
<%= javascript_pack_tag('data-turbolinks-track': true, defer: true) %>

<%= csrf_meta_tags %>
</head>
<body class="min-h-screen flex flex-col bg-sky-50 text-gray-700">
<%= react_component "NavigationBarApp" %>

<div class="container mx-auto px-4 flex-grow">
<%= yield %>
</div>

<%= react_component "Footer" %>

<%= stylesheet_pack_tag(media: 'all', 'data-turbolinks-track': true) %>
<%= javascript_pack_tag('data-turbolinks-track': true, defer: true) %>
<%= yield :body_content %>
</body>
</html>

AltStyle によって変換されたページ (->オリジナル) /