chore(client): get icons to load

This commit is contained in:
Elian Doran 2026-01-05 11:50:05 +02:00
parent 047b5a85d2
commit b745fb476e
No known key found for this signature in database
2 changed files with 9 additions and 7 deletions

View File

@ -28,7 +28,8 @@
<script> <script>
async function bootstrap() { async function bootstrap() {
await setupGlob(); await setupGlob();
await loadStylesheets(); loadStylesheets();
loadIcons();
await loadScripts(); await loadScripts();
} }
@ -43,7 +44,7 @@
}; };
} }
async function loadStylesheets() { function loadStylesheets() {
const { assetPath, themeCssUrl, themeUseNextAsBase } = window.glob; const { assetPath, themeCssUrl, themeUseNextAsBase } = window.glob;
const cssToLoad = []; const cssToLoad = [];
cssToLoad.push(`${assetPath}/stylesheets/theme-light.css`); cssToLoad.push(`${assetPath}/stylesheets/theme-light.css`);
@ -67,6 +68,12 @@
} }
} }
function loadIcons() {
const styleEl = document.createElement("style");
styleEl.innerText = window.glob.iconPackCss;
document.head.appendChild(styleEl);
}
async function loadScripts() { async function loadScripts() {
const assetPath = glob.assetPath; const assetPath = glob.assetPath;
await import(`./${assetPath}/runtime.js`); await import(`./${assetPath}/runtime.js`);

View File

@ -1,10 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<style id="trilium-icon-packs">
<%- iconPackCss %>
</style>
</head>
<body <body
class="desktop heading-style-<%= headingStyle %> layout-<%= layoutOrientation %> platform-<%= platform %> <%= isElectron ? 'electron' : '' %> <%= hasNativeTitleBar ? 'native-titlebar' : '' %> <%= hasBackgroundEffects ? 'background-effects' : '' %>" class="desktop heading-style-<%= headingStyle %> layout-<%= layoutOrientation %> platform-<%= platform %> <%= isElectron ? 'electron' : '' %> <%= hasNativeTitleBar ? 'native-titlebar' : '' %> <%= hasBackgroundEffects ? 'background-effects' : '' %>"
lang="<%= currentLocale.id %>" dir="<%= currentLocale.rtl ? 'rtl' : 'ltr' %>" lang="<%= currentLocale.id %>" dir="<%= currentLocale.rtl ? 'rtl' : 'ltr' %>"