Skip to content

Commit 62a4916

Browse files
committed
fix fouc
1 parent b3e42b7 commit 62a4916

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

app/root.res

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ let default = () => {
3030
let (isOverlayOpen, setOverlayOpen) = React.useState(_ => false)
3131
<html>
3232
<head>
33+
// This is to prevent FOUC (flash of unstyled content)
34+
// This line has to be above everything else
35+
<style> {React.string("html{opacity: 0;}")} </style>
36+
3337
<link rel="icon" href="data:image/x-icon;base64,AA" />
3438
<link rel="preload" href="../styles/main.css" type_="text/css" />
3539
<link rel="stylesheet" href="../styles/main.css" />

styles/main.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,4 +551,12 @@
551551
.CodeMirror-overlayscroll-vertical div {
552552
right: 0;
553553
width: 100%;
554+
}
555+
556+
557+
558+
/* This has to stay at the end! */
559+
/* This is to prevent FOUC (flash of unstyled content) */
560+
html {
561+
opacity: 1;
554562
}

0 commit comments

Comments
 (0)