MediaWiki:Common.css: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary |
||
Line 1,178:
/* =================================================================
11. WIKITABLES
All table styling lives here:
structural rules, text hierarchy, column widths, the sticky first
column, responsive borders, and print. Horizontal scroll is
handled by the CopyTable gadget wrapper, NOT here (overflow on a
<table> element is ignored).
================================================================= */
/* ── Design knobs — tunable here, no re-publishing needed ── */
:root {
--wt-col: 6em; /* data columns (class="col") */
--wt-col-wide: 9em; /* wide data columns (class="col-wide") */
--wt-border: #eceef1; /* hairline grid — barely visible */
--wt-rule: #72777d; /* structural rules: table top, header bottom, table bottom */
--wt-edge: #dadde1; /* frozen-column right edge (one notch stronger than grid) */
--wt-th-bg: #f6f7f9; /* header tint (try #fff once the rules carry the structure) */
--wt-th-text: #54595d; /* header text — muted vs. the near-black data */
--wt-pad-y: 0.5em; /* vertical cell padding = row height knob */
}
/* --- Full width (scroll lives on the gadget's .copy-table-scroll wrapper) --- */
.wikitable { width: 100% !important; }
/* --- Base look:
adjacent tables --- */
table.wikitable {
font-size: 0.85em;
background-color: #fff;
border: 1px solid var(--wt-border);
font-variant-numeric: tabular-nums; /* digits align vertically */
margin-top: 0.3em;
margin-bottom: 2em; /* separation between stacked tables */
}
table.wikitable td { background-color: #fff; }
Line 1,197 ⟶ 1,215:
font-weight: bold;
background-color: #fff;
padding-bottom: 0.45em; /* air between caption and table */
}
table.wikitable > tr > th,
table.wikitable > tr > td,
table.wikitable > * > tr > th,
table.wikitable > * > tr > td {
border: 1px solid var(--wt-border);
padding: var(--wt-pad-y) 0.6em;
}
table.wikitable > * > tr > th {
background-color: var(--wt-th-bg);
color: var(--wt-th-text); /* muted headers: caption > data > header */
}
.wikitable.plainrowheaders th[scope=row],
Line 1,204 ⟶ 1,233:
text-align: left;
}
/* --- Structural rules (booktabs): top, below the header block, bottom.
Painted on cells, not the table — with border-collapse a cell border
beats a table border, and an upper cell's bottom beats the next
cell's top, so these exact selectors are what makes the dark lines
win over the hairlines. --- */
table.wikitable > * > tr:first-child > th,
table.wikitable > * > tr:first-child > td {
border-top: 1px solid var(--wt-rule); /* top rule, under the caption */
}
table.wikitable > * > tr:has(> th):has(+ tr > td) > th {
border-bottom: 1px solid var(--wt-rule); /* rule under the LAST header row */
}
table.wikitable > * > tr:last-child > td,
table.wikitable > * > tr:last-child > th {
border-bottom: 1px solid var(--wt-rule); /* bottom rule */
}
/* Optional refinements — uncomment to test:
table.wikitable th { font-weight: normal; }
table.wikitable > * > tr:has(> th) > th:first-child { font-weight: normal; }
*/
/* Row hover — readability across wide rows without permanent zebra weight */
table.wikitable > tbody > tr:hover > td { background-color: #f8f9fa; }
/* ── House column widths: markers from the emitter, values here ── */
/* Floor for legacy pages published with inline widths (safe to keep wiki-wide) */
.wikitable th:not(:first-child),
.wikitable td:not(:first-child) { min-width: var(--wt-col); }
/* Marked data columns: pinned width + floor */
.wikitable th.col,
.wikitable td.col { width: var(--wt-col); min-width: var(--wt-col); }
.wikitable th.col-wide,
.wikitable td.col-wide { width: var(--wt-col-wide); min-width: var(--wt-col-wide); }
/* --- Cell content (Minerva fixes + alignment) --- */
Line 1,222 ⟶ 1,286:
/* --- Row-label (first) column: single-line, readable minimum, frozen while
scrolling, opaque background
own borders, so the right edge is painted with box-shadow — it stays
.wikitable th:first-child,
.wikitable td:first-child {
Line 1,234 ⟶ 1,298:
box-shadow: 1px 0 0 var(--wt-edge); /* right edge only — marks the frozen column */
}
.wikitable td:first-child { background-color: #fff; } /* body cells */
.wikitable th:first-child { background-color: var(--wt-th-bg); } /* header cell */
Line 1,260 ⟶ 1,324:
}
}
| |||