MediaWiki:WikiTable.css

From The Seven Sages of Rome
Revision as of 18:12, 12 March 2025 by Noeth (talk | contribs)

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.
/* Modern WikiTable Styles - Monochrome Theme */
.wikitable {
    background-color: #ffffff;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1em 0;
    width: 100%;
    overflow: hidden;
    /* Removed hard border and shadow */
    box-shadow: none;
    border-radius: 0;
}

/* Table Header - Enhanced to "pop" more */
.wikitable > tr > th,
.wikitable > * > tr > th {
    background-color: #444444; /* Darker header background */
    border: none;
    border-bottom: 3px solid #666666; /* Thicker bottom border */
    padding: 1rem 0.75rem;
    color: #ffffff; /* White text for contrast */
    font-weight: 800; /* Extra bold text */
    text-align: left;
    vertical-align: middle;
    letter-spacing: 0.5px; /* Slight letter spacing for emphasis */
}

/* Table Cells - More monochrome */
.wikitable > tr > td,
.wikitable > * > tr > td {
    border: none;
    border-bottom: 1px solid #e0e0e0; /* Light gray border */
    padding: 0.875rem 0.75rem;
    vertical-align: middle;
    color: #333333; /* Dark gray text */
}

/* Last row has no border */
.wikitable > tr:last-child > td,
.wikitable > * > tr:last-child > td {
    border-bottom: none;
}

/* Striped rows - subtle monochrome */
.wikitable > tr:nth-child(even),
.wikitable > * > tr:nth-child(even) {
    background-color: #f7f7f7; /* Very light gray */
}

/* Hover effect */
.wikitable > tbody > tr:hover,
.wikitable > * > tbody > tr:hover {
    background-color: #f0f0f0; /* Slightly darker on hover */
    transition: background-color 0.2s ease-in-out;
}

/* First column styling */
.wikitable > tr > td:first-child,
.wikitable > * > tr > td:first-child {
    font-weight: 500;
}

/* Responsive table wrapper */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
}

/* Sort indicators if sortable tables are used */
.wikitable th.headerSort {
    cursor: pointer;
    position: relative;
}

.wikitable th.headerSort:after {
    content: '⇅';
    display: inline-block;
    margin-left: 0.5em;
    opacity: 0.7;
    font-size: 0.875rem;
}

.wikitable th.headerSortUp:after {
    content: '↑';
    opacity: 1;
}

.wikitable th.headerSortDown:after {
    content: '↓';
    opacity: 1;
}

/* Caption styling */
.wikitable > caption {
    padding: 0.75rem;
    color: #666666;
    text-align: left;
    caption-side: top;
    font-style: italic;
    font-weight: 500;
    background-color: #f7f7f7;
    border-bottom: 1px solid #e0e0e0;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .wikitable > tr > th,
    .wikitable > * > tr > th,
    .wikitable > tr > td,
    .wikitable > * > tr > td {
        padding: 0.625rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* For two-column layout adjustments */
.container-fluid .row .col-md-6 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Increase spacing between tables */
.wikitable.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* Optional: Property-value column alignment for better readability */
.wikitable > tbody > tr > td:first-of-type {
    width: 40%;
}

.wikitable > tbody > tr > td:last-of-type {
    width: 60%;
}