MediaWiki:Common.css: Difference between revisions
No edit summary Tag: Manual revert |
No edit summary |
||
Line 26: | Line 26: | ||
} | } | ||
/* Apply alternating colors, padding, rounded corners, and Georgia font to all tables / | It looks like your table styling isn't being applied as expected. Here's a corrected version of the CSS that should work with MediaWiki 1.42.1. A few adjustments have been made to ensure the styles are properly applied: | ||
css | |||
Copy code | |||
/* Apply alternating colors, padding, rounded corners, and Georgia font to all tables */ | |||
table.wikitable { | table.wikitable { | ||
border-collapse: separate; / Allows border-radius to work / | border-collapse: separate; /* Allows border-radius to work */ | ||
border: 4px solid #2b2b2b; / Darker gray border / | border: 4px solid #2b2b2b; /* Darker gray border */ | ||
border-radius: 8px; / Rounded corners / | border-radius: 8px; /* Rounded corners */ | ||
overflow: hidden; / Ensures content respects rounded corners / | overflow: hidden; /* Ensures content respects rounded corners */ | ||
font-family: "Georgia", serif; / Georgia font for the entire table / | font-family: "Georgia", serif; /* Georgia font for the entire table */ | ||
color: #c1c1c1; / Default text color for table / | color: #c1c1c1; /* Default text color for table */ | ||
background-color: #4c4c4c; / Default background color for table / | background-color: #4c4c4c; /* Default background color for table */ | ||
border-color: #666666; / Darker gray border / | border-color: #666666; /* Darker gray border */ | ||
} | } | ||
/ Add extra padding to all table cells (header and data) / | /* Add extra padding to all table cells (header and data) */ | ||
table.wikitable th, table.wikitable td { | table.wikitable th, table.wikitable td { | ||
padding: 12px 16px; / 12px headroom (top/bottom), 16px side room (left/right) / | padding: 12px 16px; /* 12px headroom (top/bottom), 16px side room (left/right) */ | ||
border: 1px solid #666666; / Slightly darker gray border for cells / | border: 1px solid #666666; /* Slightly darker gray border for cells */ | ||
color: #c1c1c1; / Text color for table data cells / | color: #c1c1c1; /* Text color for table data cells */ | ||
} | } | ||
/ Apply alternating row colors / | /* Apply alternating row colors */ | ||
table.wikitable tr:nth-child(even) { | table.wikitable tr:nth-child(even) { | ||
background-color: #333333; / Darker gray for even rows / | background-color: #333333; /* Darker gray for even rows */ | ||
} | } | ||
table.wikitable tr:nth-child(odd) { | table.wikitable tr:nth-child(odd) { | ||
background-color: #4d4d4d; / Dark gray for odd rows / | background-color: #4d4d4d; /* Dark gray for odd rows */ | ||
} | } | ||
/ Style the table headers / | /* Style the table headers */ | ||
table.wikitable th { | table.wikitable th { | ||
background-color: #595959; / Header background color / | background-color: #595959; /* Header background color */ | ||
color: #ffffff; / White text for header contrast / | color: #ffffff; /* White text for header contrast */ | ||
font-weight: bold; / Bold the header text / | font-weight: bold; /* Bold the header text */ | ||
font-size: 1.2em; / Slightly larger font size for headers / | font-size: 1.2em; /* Slightly larger font size for headers */ | ||
font-family: "Georgia", serif; / Apply Georgia font to headers / | font-family: "Georgia", serif; /* Apply Georgia font to headers */ | ||
border: 1px solid #666666; / Darker gray border for header cells / | border: 1px solid #666666; /* Darker gray border for header cells */ | ||
} | } | ||
/ Keep the styling for mw_metadata tables */ | /* Keep the styling for mw_metadata tables */ | ||
table.mw_metadata td, table.mw_metadata th { | table.mw_metadata td, table.mw_metadata th { | ||
color: #c1c1c1; | color: #c1c1c1; |
Revision as of 04:09, 21 October 2024
body.page-Main_Page.action-view h1.firstHeading, body.page-Main_Page.action-submit h1.firstHeading { display: none; } .mw-page-title-main .mw-namespace { display: none; } .page-header h1.firstHeading { display: none; } #ca-nstab-main { display: none !important; } body.mw-anonuser #ca-history { display: none !important; } body.mw-anonuser #ca-view { display: none !important; } body.mw-anonuser #ca-viewsource { display: none !important; } body.mw-anonuser #ca-login { display: none !important; } It looks like your table styling isn't being applied as expected. Here's a corrected version of the CSS that should work with MediaWiki 1.42.1. A few adjustments have been made to ensure the styles are properly applied: css Copy code /* Apply alternating colors, padding, rounded corners, and Georgia font to all tables */ table.wikitable { border-collapse: separate; /* Allows border-radius to work */ border: 4px solid #2b2b2b; /* Darker gray border */ border-radius: 8px; /* Rounded corners */ overflow: hidden; /* Ensures content respects rounded corners */ font-family: "Georgia", serif; /* Georgia font for the entire table */ color: #c1c1c1; /* Default text color for table */ background-color: #4c4c4c; /* Default background color for table */ border-color: #666666; /* Darker gray border */ } /* Add extra padding to all table cells (header and data) */ table.wikitable th, table.wikitable td { padding: 12px 16px; /* 12px headroom (top/bottom), 16px side room (left/right) */ border: 1px solid #666666; /* Slightly darker gray border for cells */ color: #c1c1c1; /* Text color for table data cells */ } /* Apply alternating row colors */ table.wikitable tr:nth-child(even) { background-color: #333333; /* Darker gray for even rows */ } table.wikitable tr:nth-child(odd) { background-color: #4d4d4d; /* Dark gray for odd rows */ } /* Style the table headers */ table.wikitable th { background-color: #595959; /* Header background color */ color: #ffffff; /* White text for header contrast */ font-weight: bold; /* Bold the header text */ font-size: 1.2em; /* Slightly larger font size for headers */ font-family: "Georgia", serif; /* Apply Georgia font to headers */ border: 1px solid #666666; /* Darker gray border for header cells */ } /* Keep the styling for mw_metadata tables */ table.mw_metadata td, table.mw_metadata th { color: #c1c1c1; background-color: #4c4c4c; border-color: #666666; } table.mw_metadata th { background-color: #595959; }