mirror of
https://github.com/litruv/Docs-Viewer.git
synced 2026-07-24 02:36:07 +10:00
Add support for loading custom CSS files in Documentation and adjust body padding in styles
This commit is contained in:
11
index.js
11
index.js
@@ -540,6 +540,17 @@ class Documentation {
|
|||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
this.indexData = data;
|
this.indexData = data;
|
||||||
window._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);
|
this.populateAuthorInfo(data.author);
|
||||||
window.originalDocTitle = data.metadata.site_name || 'Documentation';
|
window.originalDocTitle = data.metadata.site_name || 'Documentation';
|
||||||
|
|||||||
@@ -261,9 +261,10 @@ body {
|
|||||||
color: var(--ifm-color-content-secondary);
|
color: var(--ifm-color-content-secondary);
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
transition: color 0.2s;
|
transition: color 0.2s;
|
||||||
|
padding: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
social-links a:hover {
|
.social-links a:hover {
|
||||||
color: var(--ifm-color-primary);
|
color: var(--ifm-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user