Skip to content

Commit bcf41a1

Browse files
committed
Add support for loading custom CSS files in Documentation and adjust body padding in styles
1 parent 6898e3a commit bcf41a1

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,17 @@ class Documentation {
540540
const data = await response.json();
541541
this.indexData = data;
542542
window._indexData = data;
543+
544+
// Load custom CSS files if specified
545+
if (data.customCSS) {
546+
const cssFiles = Array.isArray(data.customCSS) ? data.customCSS : [data.customCSS];
547+
cssFiles.forEach(cssFile => {
548+
const link = document.createElement('link');
549+
link.rel = 'stylesheet';
550+
link.href = cssFile;
551+
document.head.appendChild(link);
552+
});
553+
}
543554

544555
this.populateAuthorInfo(data.author);
545556
window.originalDocTitle = data.metadata.site_name || 'Documentation';

styles.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,10 @@ body {
261261
color: var(--ifm-color-content-secondary);
262262
font-size: 1.2rem;
263263
transition: color 0.2s;
264+
padding: 0.5rem;
264265
}
265266

266-
social-links a:hover {
267+
.social-links a:hover {
267268
color: var(--ifm-color-primary);
268269
}
269270

0 commit comments

Comments
 (0)