Difference between revisions of "MediaWiki:Common.css"

From Filtered, Archived, Gaslit Wiki
Jump to navigation Jump to search
Line 1: Line 1:
/* CSS placed here will be applied to all skins */
+
// Create a new style element
 +
const style = document.createElement('style');
  
/* Set body text color */
+
// Add CSS rules to the style element
body {  
+
style.innerText += `
     background: #252525;  
+
  /* Set basic styles for tables with the class 'wikitable' */
     color: #e6e6e6 !important; /* Force text color */
+
  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 */
 +
  }
  
/* Background color of the content and title of pages */
+
  /* Set styles for table headers */
#content {  
+
  table.wikitable th {
     background-color: #252525;  
+
     background-color: #343434 !important; /* Match content background color */
     color: #e6e6e6 !important; /* Force text 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 */
 +
  }
  
/* Sets background color of the logo area  */
+
  /* Set styles for table data cells */
#p-logo {  
+
  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 */
 +
  }
  
/* Navigation menu */
+
  /* Set styles for even table rows */
#p-navigation {  
+
  table.wikitable tr:nth-child(even) td {
     background-color: #252525;  
+
     background-color: #343434 !important; /* Match content background color */
}
+
  }
  
/* Table of contents */
+
  /* Set styles for links within the table */
.mw-parser-output .toc {
+
  table.wikitable a {
     background-color: #343434;
+
     color: #90b7f9 !important; /* Match link color */
    border: 1px solid #444241;  
+
  }
}
 
  
/* Headings */
+
  /* Set styles for visited links */
h1, h2, h3 {
+
  table.wikitable a:visited {
     color: #e6e6e6 !important; /* Force heading colors */
+
     color: #7a94bf !important; /* Adjusted for contrast */
}
+
  }
  
/* Links */
+
  /* Set styles for hovered links */
a {
+
  table.wikitable a:hover {
     color: #90b7f9;  
+
     color: #c70039 !important; /* Match hover link color */
}
+
     text-decoration: underline; /* Underline links on hover */
a:hover {
+
  }
     color: #c70039;  
+
`;
}
 
  
/* Top bar */
+
// Append the style element to the document's head
#mw-head {
+
document.head.appendChild(style);
    background-color: #252525;
 
}
 
#mw-head a {
 
    color: #e6e6e6 !important; /* Force link color in top bar */
 
}
 
 
 
/* View, edit, history bar */
 
#ca-view,
 
#ca-edit,
 
#ca-history {
 
    background-color: #7f7f7f;
 
    color: #e6e6e6 !important; /* Force text color */
 
}
 
 
 
/* Notable members table */
 
.notable-members {
 
    background-color: #343434 !important;  
 
    color: #e6e6e6 !important;
 
}
 
.notable-members th, .notable-members td {
 
    border: 2px solid #e6e6e6;
 
    color: #e6e6e6 !important; /* Force cell text color */
 
}
 

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);