File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -756,6 +756,20 @@ class Documentation {
756756 this . setupKeyboardShortcuts ( ) ;
757757 }
758758
759+ /**
760+ * Loads a custom CSS file if specified in the index.json
761+ * @param {string } customCSSPath - Path to the custom CSS file relative to document root
762+ */
763+ loadCustomCSS ( customCSSPath ) {
764+ if ( ! customCSSPath ) return ;
765+
766+ const link = document . createElement ( 'link' ) ;
767+ link . rel = 'stylesheet' ;
768+ link . type = 'text/css' ;
769+ link . href = customCSSPath ; // Path is relative to document root
770+ document . head . appendChild ( link ) ;
771+ }
772+
759773 setupEventListeners ( ) {
760774 this . eventBus . on ( 'navigation:requested' , async ( { slug, hash } ) => {
761775 slug = slug . replace ( / ^ [ ? = ] / , '' ) ;
@@ -864,6 +878,11 @@ class Documentation {
864878 this . indexData = data ;
865879 window . _indexData = data ;
866880
881+ // Load custom CSS if provided in index.json
882+ if ( data . customCSS ) {
883+ this . loadCustomCSS ( data . customCSS ) ;
884+ }
885+
867886 this . searchService . buildSearchIndex ( this . indexData . documents ) ;
868887 this . domService . setupSearch ( this . searchService ) ;
869888
You can’t perform that action at this time.
0 commit comments