User:TheMcr/monobook.js: Difference between revisions

Boobpedia - Encyclopedia of big boobs
Jump to navigationJump to search
No edit summary
No edit summary
Line 2: Line 2:
var customStyle = document.createElement("style");
var customStyle = document.createElement("style");
customStyle.innerHTML = `
customStyle.innerHTML = `
  body {
    /* Change background color */
  font: x-small sans-serif;
    body {
  background: #990000 url(/wiki/skins/monobook/headbg.jpg) 0 0 no-repeat;
        background-color: #f4f4f4 !important;
  color: rgb(255, 255, 255);
    }
  margin: 0;
 
  padding: 0;
    /* Customize the sidebar */
}
    #mw-panel {
        background: #333 !important;
        color: white !important;
    }
 
    #mw-panel a {
        color: #ffcc00 !important;
    }
 
    /* Change the font of the content */
    #mw-content-text {
        font-family: Arial, sans-serif !important;
        font-size: 16px !important;
    }
 
    /* Hide the "edit" button */
    .mw-editsection {
        display: none !important;
    }
 
    /* Improve tables */
    table.wikitable {
        border-collapse: collapse !important;
        border: 2px solid #444 !important;
        background-color: #fff !important;
    }
 
    table.wikitable th {
        background-color: #333 !important;
        color: white !important;
        padding: 8px !important;
    }
 
    table.wikitable td {
        padding: 6px !important;
    }
 
    /* Highlight links on hover */
    a:hover {
        color: red !important;
        text-decoration: underline !important;
    }
`;
`;


// Append the <style> element to the document head
// Append the <style> element to the document head
document.head.appendChild(customStyle);
document.head.appendChild(customStyle);
console.log("Custom CSS applied via JavaScript!");
alert("Custom CSS applied via JavaScript!");

Revision as of 22:29, 1 April 2025

// Create a new <style> element
var customStyle = document.createElement("style");
customStyle.innerHTML = `
    /* Change background color */
    body {
        background-color: #f4f4f4 !important;
    }

    /* Customize the sidebar */
    #mw-panel {
        background: #333 !important;
        color: white !important;
    }

    #mw-panel a {
        color: #ffcc00 !important;
    }

    /* Change the font of the content */
    #mw-content-text {
        font-family: Arial, sans-serif !important;
        font-size: 16px !important;
    }

    /* Hide the "edit" button */
    .mw-editsection {
        display: none !important;
    }

    /* Improve tables */
    table.wikitable {
        border-collapse: collapse !important;
        border: 2px solid #444 !important;
        background-color: #fff !important;
    }

    table.wikitable th {
        background-color: #333 !important;
        color: white !important;
        padding: 8px !important;
    }

    table.wikitable td {
        padding: 6px !important;
    }

    /* Highlight links on hover */
    a:hover {
        color: red !important;
        text-decoration: underline !important;
    }
`;

// Append the <style> element to the document head
document.head.appendChild(customStyle);
alert("Custom CSS applied via JavaScript!");