6161 cursor : pointer;
6262 transition : background-color 0.2s ease;
6363 text-decoration : none;
64- color : inherit;
64+ color : # 333333 ;
65+ }
66+ [data-theme = "dark" ] tags span , [data-theme = "dark" ] tags a .tag-link {
67+ background-color : # 2a2a30 ;
68+ color : # ffffff ;
69+ border : 1px solid rgba (111 , 161 , 255 , 0.3 );
6570 }
6671 tags span : hover , tags a .tag-link : hover {
6772 background-color : # e0e0e0 ;
6873 }
74+ [data-theme = "dark" ] tags span : hover , [data-theme = "dark" ] tags a .tag-link : hover {
75+ background-color : # 3a3a40 ;
76+ }
6977 tags span .active , tags a .tag-link .active {
7078 background-color : # 007bff ;
7179 color : white;
7280 }
81+ [data-theme = "dark" ] tags span .active , [data-theme = "dark" ] tags a .tag-link .active {
82+ background-color : # 4d8dff ;
83+ color : white;
84+ }
7385 /* Style for filter notification */
7486 .filter-note {
7587 margin : 1rem 0 ;
152164 < script defer src ="https://cdn.jsdelivr.net/npm/marked/marked.min.js "> </ script >
153165 < script defer src ="
https://cdn.jsdelivr.net/npm/[email protected] "
> </ script > 154166 < script defer src ="/assets/js/main.js "> </ script >
167+ < script defer src ="/assets/js/platform-utils.js "> </ script >
155168 < script defer src ="/assets/js/command-data.js "> </ script >
156169 < script >
157170 document . documentElement . classList . remove ( 'no-js' ) ;
195208 < script >
196209 // Check if we're on localhost
197210 if ( window . location . hostname === 'localhost' || window . location . hostname === '127.0.0.1' ) {
198- // Load only specific Font Awesome icons for local development
199- var icons = [ 'github' , 'search' , 'arrow-up-right-from-square' , 'bluesky' , 'youtube' , 'arrow-up' ] ;
200- var link = document . createElement ( 'link' ) ;
201- link . rel = 'stylesheet' ;
202- link . href = 'https://use.fontawesome.com/releases/v6.7.2/css/solid.css' ;
203- link . crossOrigin = 'anonymous' ;
204- document . head . appendChild ( link ) ;
205-
206- var link2 = document . createElement ( 'link' ) ;
207- link2 . rel = 'stylesheet' ;
208- link2 . href = 'https://use.fontawesome.com/releases/v6.7.2/css/brands.css' ;
209- link2 . crossOrigin = 'anonymous' ;
210- document . head . appendChild ( link2 ) ;
211+ // Load Font Awesome stylesheets with improved error handling and version extraction
212+ function loadStylesheet ( href ) {
213+ const link = document . createElement ( 'link' ) ;
214+ link . rel = 'stylesheet' ;
215+ link . href = href ;
216+ link . crossOrigin = 'anonymous' ;
217+ link . onerror = ( ) => console . error ( `Failed to load stylesheet: ${ href } ` ) ;
218+ document . head . appendChild ( link ) ;
219+ return link ;
220+ }
221+
222+ const FA_VERSION = '6.7.2' ; // Extract version to a constant for easier updates
211223
212- var link3 = document . createElement ( 'link' ) ;
213- link3 . rel = 'stylesheet' ;
214- link3 . href = 'https://use.fontawesome.com/releases/v6.7.2/css/fontawesome.css' ;
215- link3 . crossOrigin = 'anonymous' ;
216- document . head . appendChild ( link3 ) ;
224+ loadStylesheet ( `https://use.fontawesome.com/releases/v${ FA_VERSION } /css/solid.css` ) ;
225+ loadStylesheet ( `https://use.fontawesome.com/releases/v${ FA_VERSION } /css/brands.css` ) ;
226+ loadStylesheet ( `https://use.fontawesome.com/releases/v${ FA_VERSION } /css/fontawesome.css` ) ;
217227 } else {
218228 // Use Kit for production with defer
219229 var script = document . createElement ( 'script' ) ;
@@ -516,7 +526,12 @@ <h3>Contents</h3>
516526 const updateMatchingTags = ( tagText , shouldHighlight ) => {
517527 document . querySelectorAll ( 'tags span' ) . forEach ( tag => {
518528 if ( tag . textContent === tagText ) {
519- tag . classList . toggle ( 'active' , shouldHighlight ) ;
529+ // First remove any active class
530+ tag . classList . remove ( 'active' ) ;
531+ // Then add it back if needed
532+ if ( shouldHighlight ) {
533+ tag . classList . add ( 'active' ) ;
534+ }
520535 }
521536 } ) ;
522537 } ;
@@ -529,7 +544,8 @@ <h3>Contents</h3>
529544 // If clicking the active tag, deactivate it
530545 if ( activeTag === tagText ) {
531546 activeTag = null ;
532- updateMatchingTags ( tagText , false ) ;
547+ // Remove active class from all tags
548+ allTags . forEach ( t => t . classList . remove ( 'active' ) ) ;
533549 paperContainers . forEach ( container => {
534550 container . classList . remove ( 'hidden' ) ;
535551 } ) ;
@@ -539,7 +555,9 @@ <h3>Contents</h3>
539555
540556 // Update active tag
541557 activeTag = tagText ;
558+ // Remove active class from all tags
542559 allTags . forEach ( t => t . classList . remove ( 'active' ) ) ;
560+ // Add active class to matching tags
543561 updateMatchingTags ( tagText , true ) ;
544562
545563 // Update URL
0 commit comments