Difference between revisions of "MediaWiki:Common.css"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
− | / | + | // Create a new style element |
+ | const style = document.createElement('style'); | ||
− | /* Set | + | // Add CSS rules to the style element |
− | + | style.innerText += ` | |
− | background: #252525; | + | /* Set basic styles for tables with the class 'wikitable' */ |
− | color: #e6e6e6 !important; /* | + | table.wikitable { |
− | } | + | background-color: #252525 !important; /* Match body background color */ |
+ | color: #e6e6e6 !important; /* Match body text color */ | ||
+ | border: 1px solid #444241 !important; /* Border color */ | ||
+ | border-collapse: collapse !important; /* Collapse borders */ | ||
+ | width: 100%; /* Full width of the container */ | ||
+ | } | ||
− | /* | + | /* Set styles for table headers */ |
− | + | table.wikitable th { | |
− | background-color: # | + | background-color: #343434 !important; /* Match content background color */ |
− | color: #e6e6e6 !important; /* | + | color: #e6e6e6 !important; /* Match text color */ |
− | } | + | border: 2px solid #e6e6e6 !important; /* Border color for headers */ |
+ | padding: 8px; /* Padding inside header cells */ | ||
+ | text-align: left; /* Align text to the left */ | ||
+ | } | ||
− | /* | + | /* Set styles for table data cells */ |
− | + | table.wikitable td { | |
− | background-color: #252525; | + | background-color: #252525 !important; /* Match body background color */ |
− | } | + | color: #e6e6e6 !important; /* Match text color */ |
+ | border: 2px solid #e6e6e6 !important; /* Border color for data cells */ | ||
+ | padding: 8px; /* Padding inside data cells */ | ||
+ | } | ||
− | /* | + | /* Set styles for even table rows */ |
− | + | table.wikitable tr:nth-child(even) td { | |
− | background-color: # | + | background-color: #343434 !important; /* Match content background color */ |
− | } | + | } |
− | /* | + | /* Set styles for links within the table */ |
− | . | + | table.wikitable a { |
− | + | color: #90b7f9 !important; /* Match link color */ | |
− | + | } | |
− | } | ||
− | /* | + | /* Set styles for visited links */ |
− | + | table.wikitable a:visited { | |
− | color: # | + | color: #7a94bf !important; /* Adjusted for contrast */ |
− | } | + | } |
− | /* | + | /* Set styles for hovered links */ |
− | a { | + | table.wikitable a:hover { |
− | color: # | + | color: #c70039 !important; /* Match hover link color */ |
− | + | text-decoration: underline; /* Underline links on hover */ | |
− | + | } | |
− | + | `; | |
− | } | ||
− | / | + | // Append the style element to the document's head |
− | + | document.head.appendChild(style); | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | . | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 19:48, 4 May 2025
// Create a new style element const style = document.createElement('style'); // Add CSS rules to the style element style.innerText += ` /* Set basic styles for tables with the class 'wikitable' */ table.wikitable { background-color: #252525 !important; /* Match body background color */ color: #e6e6e6 !important; /* Match body text color */ border: 1px solid #444241 !important; /* Border color */ border-collapse: collapse !important; /* Collapse borders */ width: 100%; /* Full width of the container */ } /* Set styles for table headers */ table.wikitable th { background-color: #343434 !important; /* Match content background color */ color: #e6e6e6 !important; /* Match text color */ border: 2px solid #e6e6e6 !important; /* Border color for headers */ padding: 8px; /* Padding inside header cells */ text-align: left; /* Align text to the left */ } /* Set styles for table data cells */ table.wikitable td { background-color: #252525 !important; /* Match body background color */ color: #e6e6e6 !important; /* Match text color */ border: 2px solid #e6e6e6 !important; /* Border color for data cells */ padding: 8px; /* Padding inside data cells */ } /* Set styles for even table rows */ table.wikitable tr:nth-child(even) td { background-color: #343434 !important; /* Match content background color */ } /* Set styles for links within the table */ table.wikitable a { color: #90b7f9 !important; /* Match link color */ } /* Set styles for visited links */ table.wikitable a:visited { color: #7a94bf !important; /* Adjusted for contrast */ } /* Set styles for hovered links */ table.wikitable a:hover { color: #c70039 !important; /* Match hover link color */ text-decoration: underline; /* Underline links on hover */ } `; // Append the style element to the document's head document.head.appendChild(style);