Skip to content

Commit

Permalink
Change: move custom.css linking to head to avoid FOUC (gethomepage#2916)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
  • Loading branch information
2 people authored and Plancke committed Feb 23, 2024
1 parent 8918799 commit 2dd76c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
10 changes: 0 additions & 10 deletions src/components/filecontent.jsx

This file was deleted.

12 changes: 2 additions & 10 deletions src/pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { useRouter } from "next/router";

import Tab, { slugify } from "components/tab";
import FileContent from "components/filecontent";
import ServicesGroup from "components/services/group";
import BookmarksGroup from "components/bookmarks/group";
import Widget, { isRightAligned as isRightAlignedWidget } from "components/widgets/widget";
Expand Down Expand Up @@ -389,17 +388,10 @@ function Home({ initialSettings }) {
)}
<meta name="msapplication-TileColor" content={themes[settings.color || "slate"][settings.theme || "dark"]} />
<meta name="theme-color" content={themes[settings.color || "slate"][settings.theme || "dark"]} />
<link rel="preload" href="/api/config/custom.css" as="style" />
<link rel="stylesheet" href="/api/config/custom.css" /> {/* eslint-disable-line @next/next/no-css-tags */}
</Head>

<link rel="preload" href="/api/config/custom.css" as="fetch" crossOrigin="anonymous" />
<style data-name="custom.css">
<FileContent
path="custom.css"
loadingValue="/* Loading custom CSS... */"
errorValue="/* Failed to load custom CSS... */"
emptyValue="/* No custom CSS */"
/>
</style>
<Script src="/api/config/custom.js" />

<div className="relative container m-auto flex flex-col justify-start z-10 h-full">
Expand Down

0 comments on commit 2dd76c3

Please sign in to comment.