Jump to content

MediaWiki:Common.css: Difference between revisions

From Knowledge Base
No edit summary
No edit summary
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
// Load Prism.js (ensure correct path)
/*Hide sidebar links*/
importScriptURI('/prism.js');  // Adjust if necessary
#p-tb {
    display: none !important;
}
 
#p-search { display: none; }
 
/* Comments should always take priority */
pre.csharp .csharp-comment {
    color: green;
    font-style: italic;
    z-index: 10; /* Ensure it's on top */
    position: relative; /* Prevent overlaps */
}
 
/* Add z-index to other elements to prevent overlap */
pre.csharp span {
    position: relative;
    z-index: 1;
}
 
/* Styling for C# keywords */
.csharp-keyword {
    color: #1E90FF; /* DodgerBlue */
    font-weight: bold;
}
 
/* Styling for C# types */
.csharp-type {
    color: #8A2BE2; /* BlueViolet */
    font-weight: bold;
}
 
/* Styling for C# method names */
.csharp-method {
    color: #3CB371; /* MediumSeaGreen */
    font-weight: bold;
}
 
/* Styling for C# variables */
.csharp-variable {
    color: #FF8C00; /* DarkOrange */
    font-style: italic;
}


// Load Prism.css (ensure correct path)
/* Styling for C# class names */
var link = document.createElement('link');
.csharp-class {
link.rel = 'stylesheet';
    color: #6A5ACD; /* SlateBlue */
link.type = 'text/css';
    font-weight: bold;
link.href = '/prism.css'; // Adjust if necessary
}
document.head.appendChild(link);


// Optional: log to check if Prism.js is loaded
/* Styling for C# property names */
if (typeof Prism !== "undefined") {
.csharp-property {
     console.log("Prism.js loaded successfully.");
     color: #00BFFF; /* DeepSkyBlue */
} else {
     font-style: italic;
     console.error("Prism.js is not loaded.");
}
}


// Initialize syntax highlighting after page load
/* Styling for curly braces */
$(document).ready(function() {
.csharp-brace {
     if (typeof Prism !== "undefined") {
     font-weight: bold;
        Prism.highlightAll();
    font-size: 1.1em;
        console.log("Prism.js executed successfully on all code blocks.");
}
     } else {
 
        console.error("Prism.js not found when trying to highlight code.");
/* Add spacing for nested items */
     }
ul {
});
    margin-left: 20px;
}
 
/* Improve readability of bullet points */
ul li {
     margin-bottom: 5px;
}
 
/* Optional: Style for section titles for better separation */
h2, h3, h4 {
    margin-top: 20px;
    margin-bottom: 10px;
     color: #2c3e50;
}

Latest revision as of 07:55, 20 January 2025

/*Hide sidebar links*/
#p-tb {
    display: none !important;
}

#p-search { display: none; }

/* Comments should always take priority */
pre.csharp .csharp-comment {
    color: green;
    font-style: italic;
    z-index: 10; /* Ensure it's on top */
    position: relative; /* Prevent overlaps */
}

/* Add z-index to other elements to prevent overlap */
pre.csharp span {
    position: relative;
    z-index: 1;
}

/* Styling for C# keywords */
.csharp-keyword {
    color: #1E90FF; /* DodgerBlue */
    font-weight: bold;
}

/* Styling for C# types */
.csharp-type {
    color: #8A2BE2; /* BlueViolet  */
    font-weight: bold;
}

/* Styling for C# method names */
.csharp-method {
    color: #3CB371; /* MediumSeaGreen */
    font-weight: bold;
}

/* Styling for C# variables */
.csharp-variable {
    color: #FF8C00; /* DarkOrange */
    font-style: italic;
}

/* Styling for C# class names */
.csharp-class {
    color: #6A5ACD; /* SlateBlue */
    font-weight: bold;
}

/* Styling for C# property names */
.csharp-property {
    color: #00BFFF; /* DeepSkyBlue */
    font-style: italic;
}

/* Styling for curly braces */
.csharp-brace {
    font-weight: bold;
    font-size: 1.1em;
}

/* Add spacing for nested items */
ul {
    margin-left: 20px;
}

/* Improve readability of bullet points */
ul li {
    margin-bottom: 5px;
}

/* Optional: Style for section titles for better separation */
h2, h3, h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #2c3e50;
}