Move FA CSS to app.postcss

This commit is contained in:
Max Stanley
2024-03-02 14:44:52 +00:00
parent e5e6045723
commit fe3e283b3e
3 changed files with 4 additions and 11 deletions
-3
View File
@@ -15,9 +15,6 @@
<link rel="mask-icon" href="%sveltekit.assets%/favicon.svg" color="#000000" />
<meta name="theme-color" content="#6366F1" />
<link rel="manifest" href="%sveltekit.assets%/manifest.json" />
<style>
@import '@fortawesome/fontawesome-free/css/all.min.css';
</style>
%sveltekit.head%
</head>
<body style="overflow: hidden;">
+3 -1
View File
@@ -1,7 +1,9 @@
@import '@fortawesome/fontawesome-free/css/all.min.css';
@tailwind base;
@tailwind components;
@tailwind utilities;
.input {
@apply flex-1 rounded border-2 border-solid border-primary;
}
+1 -7
View File
@@ -72,14 +72,8 @@
const getSvgElement = () => {
const svgElement = document.querySelector('#container svg')?.cloneNode(true) as HTMLElement;
svgElement.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
const fontAwesomeCdnUrl = [...document.head.querySelectorAll('link')]
.map((link) => link.href)
.find((url) => url.includes('font-awesome'));
if (fontAwesomeCdnUrl == null) {
return svgElement;
}
const styleElement = document.createElement('style');
styleElement.textContent = `@import url("${fontAwesomeCdnUrl}");'`;
styleElement.textContent = "@import '@fortawesome/fontawesome-free/css/all.min.css';";
svgElement.prepend(styleElement);
return svgElement;
};