[PR #1379] [CLOSED] Prevent FOUC by briefly hiding the document body #15886

Closed
opened 2025-11-02 11:56:53 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/1379
Author: @silverwind
Created: 3/23/2017
Status: Closed

Base: masterHead: fouc


📝 Commits (1)

  • 7d23186 Prevent FOUC by briefly hiding the document body

📊 Changes

1 file changed (+7 additions, -0 deletions)

View changed files

📝 templates/base/head.tmpl (+7 -0)

📄 Description

Issue

Gitea currently has a pretty nasty FOUC, especially visible in Firefox:

Solution

By briefly hiding the <body> and showing it once DOM content is loaded, we can efficiently prevent FOUC without side effects (the site keeps working without JS enabled).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/1379 **Author:** [@silverwind](https://github.com/silverwind) **Created:** 3/23/2017 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fouc` --- ### 📝 Commits (1) - [`7d23186`](https://github.com/go-gitea/gitea/commit/7d2318619ac45ed9a4c0dd898f99a059e7e5f9e8) Prevent FOUC by briefly hiding the document body ### 📊 Changes **1 file changed** (+7 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `templates/base/head.tmpl` (+7 -0) </details> ### 📄 Description ## Issue Gitea currently has a pretty nasty [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content), especially visible in Firefox: ![](https://cloud.githubusercontent.com/assets/115237/24269644/5d6857fa-1012-11e7-94d8-1bcb59135b60.gif) ## Solution By briefly hiding the `<body>` and showing it once DOM content is loaded, we can efficiently prevent FOUC without side effects (the site keeps working without JS enabled). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 11:56:53 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#15886