From bcf41a1fff759c4620ba6ac65ba74b1223d5ae42 Mon Sep 17 00:00:00 2001 From: Max Litruv Boonzaayer Date: Mon, 10 Feb 2025 16:00:31 +1100 Subject: [PATCH] Add support for loading custom CSS files in Documentation and adjust body padding in styles --- index.js | 11 +++++++++++ styles.css | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index b6c53a8..83eb5ed 100644 --- a/index.js +++ b/index.js @@ -540,6 +540,17 @@ class Documentation { const data = await response.json(); this.indexData = data; window._indexData = data; + + // Load custom CSS files if specified + if (data.customCSS) { + const cssFiles = Array.isArray(data.customCSS) ? data.customCSS : [data.customCSS]; + cssFiles.forEach(cssFile => { + const link = document.createElement('link'); + link.rel = 'stylesheet'; + link.href = cssFile; + document.head.appendChild(link); + }); + } this.populateAuthorInfo(data.author); window.originalDocTitle = data.metadata.site_name || 'Documentation'; diff --git a/styles.css b/styles.css index 32b1c37..092ca0e 100644 --- a/styles.css +++ b/styles.css @@ -261,9 +261,10 @@ body { color: var(--ifm-color-content-secondary); font-size: 1.2rem; transition: color 0.2s; + padding: 0.5rem; } -social-links a:hover { +.social-links a:hover { color: var(--ifm-color-primary); }