Evite le flash HTML avant le chargement du CSS

This commit is contained in:
2026-04-13 20:56:45 +02:00
parent 5c53b475b2
commit b11056097d
3 changed files with 6 additions and 12 deletions

View File

@@ -51,10 +51,8 @@
return `${assetUrl.pathname}${assetUrl.search}${assetUrl.hash}`; return `${assetUrl.pathname}${assetUrl.search}${assetUrl.hash}`;
}; };
const stylesheet = document.createElement("link"); const stylesheetHref = window.__CHESSCUBING_ASSET_URL__("styles.css");
stylesheet.rel = "stylesheet"; document.write(`<link rel="stylesheet" href="${stylesheetHref}" />`);
stylesheet.href = window.__CHESSCUBING_ASSET_URL__("styles.css");
document.head.append(stylesheet);
})(); })();
</script> </script>
</head> </head>

View File

@@ -51,10 +51,8 @@
return `${assetUrl.pathname}${assetUrl.search}${assetUrl.hash}`; return `${assetUrl.pathname}${assetUrl.search}${assetUrl.hash}`;
}; };
const stylesheet = document.createElement("link"); const stylesheetHref = window.__CHESSCUBING_ASSET_URL__("styles.css");
stylesheet.rel = "stylesheet"; document.write(`<link rel="stylesheet" href="${stylesheetHref}" />`);
stylesheet.href = window.__CHESSCUBING_ASSET_URL__("styles.css");
document.head.append(stylesheet);
})(); })();
</script> </script>
</head> </head>

View File

@@ -51,10 +51,8 @@
return `${assetUrl.pathname}${assetUrl.search}${assetUrl.hash}`; return `${assetUrl.pathname}${assetUrl.search}${assetUrl.hash}`;
}; };
const stylesheet = document.createElement("link"); const stylesheetHref = window.__CHESSCUBING_ASSET_URL__("styles.css");
stylesheet.rel = "stylesheet"; document.write(`<link rel="stylesheet" href="${stylesheetHref}" />`);
stylesheet.href = window.__CHESSCUBING_ASSET_URL__("styles.css");
document.head.append(stylesheet);
})(); })();
</script> </script>
</head> </head>