User:TheMcr/monobook.js

Boobpedia - Encyclopedia of big boobs
Jump to navigationJump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
// 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!");