Jump to content

MediaWiki:Mainpage.css: Difference between revisions

From ZelocoreCMS Wiki
Applied robust, multi-device responsive CSS rules.
Tag: Reverted
No edit summary
Tag: Reverted
Line 1: Line 1:
/* MediaWiki:Mainpage.css - Dedicated CSS for the Main Page layout */
/* MediaWiki:Mainpage.css - Improved dedicated CSS for Main Page */


/* Hide the page title on Main_Page */
/* ============================================================
#firstHeading, .firstHeading, .mw-page-title-main, .page-header__title { display: none !important; }
Β  MAIN PAGE ONLY SAFETY
Β  ============================================================ */
Β 
/* Hide the page title only on Main Page */
body.page-Main_Page #firstHeading,
body.page-Main_Page .firstHeading,
body.page-Main_Page .mw-page-title-main,
body.page-Main_Page .page-header__title {
display: none !important;
}
Β 
/* General spacing cleanup for main page content */
body.page-Main_Page .mw-parser-output {
font-size: 100%;
line-height: 1.6;
}
Β 
/* ============================================================
Β  TOP BANNER
Β  ============================================================ */


/* Top banner */
#mp-topbanner {
#mp-topbanner {
Β  background: #cee0f2;
background: #cee0f2;
Β  border: 1px solid #a2a9b1;
border: 1px solid #a2a9b1;
Β  padding: 12px 16px;
padding: 12px 16px;
Β  margin-bottom: 14px;
margin: 0 0 14px 0;
Β  text-align: center;
text-align: center;
Β  font-size: 1.05em;
font-size: 1.05em;
line-height: 1.5;
box-sizing: border-box;
}
}


/* Two-column layout - Desktop */
/* ============================================================
Β  TWO-COLUMN LAYOUT
Β  ============================================================ */
Β 
#mp-upper {
#mp-upper {
Β  display: flex;
display: flex;
Β  flex-wrap: nowrap; /* Prevent messy wrapping on desktop, let media queries handle it */
flex-wrap: nowrap;
Β  gap: 15px;
gap: 15px;
Β  margin-bottom: 14px;
margin: 0 0 14px 0;
Β  align-items: flex-start;
align-items: flex-start;
}
}


#mp-left {
#mp-left {
Β  flex: 1 1 55%;
flex: 1 1 55%;
Β  min-width: 0; /* Prevents overflow issues */
min-width: 0;
}
}


#mp-right {
#mp-right {
Β  flex: 1 1 45%;
flex: 1 1 45%;
Β  min-width: 0;
min-width: 0;
}
}


/* Headings */
/* ============================================================
Β  SECTION HEADINGS
Β  ============================================================ */
Β 
.mp-h2 {
.mp-h2 {
Β  background: #cee0f2;
background: #cee0f2;
Β  border: 1px solid #a2a9b1;
border: 1px solid #a2a9b1;
Β  border-bottom: none;
border-bottom: none;
Β  padding: 5px 10px;
padding: 6px 10px;
Β  font-size: 1em;
margin: 0;
Β  font-weight: bold;
font-size: 1em;
Β  color: #202122;
font-weight: 700;
Β  margin: 0;
line-height: 1.4;
color: #202122;
}
Β 
.mp-h2-yellow {
background: #fef6e7;
}
Β 
.mp-h2-green {
background: #ecf5ec;
}
}
.mp-h2-yellow { background: #fef6e7; }
.mp-h2-greenΒ  { background: #ecf5ec; }
.mp-h2-grayΒ  { background: #dce3ee; }


/* Body of sections */
.mp-h2-gray {
background: #dce3ee;
}
Β 
/* ============================================================
Β  SECTION BODIES
Β  ============================================================ */
Β 
.mp-body {
.mp-body {
Β  background: #ffffff;
background: #ffffff;
Β  border: 1px solid #a2a9b1;
border: 1px solid #a2a9b1;
Β  border-top: none;
border-top: none;
Β  padding: 10px 12px;
padding: 10px 12px;
Β  margin-bottom: 12px;
margin: 0 0 12px 0;
Β  font-size: 0.9em;
font-size: 0.95em;
Β  line-height: 1.6;
line-height: 1.65;
Β  color: #202122;
color: #202122;
Β  overflow-x: auto; /* Allow tables to scroll horizontally safely */
box-sizing: border-box;
Β  box-sizing: border-box;
word-wrap: break-word;
overflow-wrap: anywhere;
}
Β 
/* Paragraphs */
.mp-body p {
margin: 0 0 0.8em 0;
}
}
.mp-body ul { margin: 0; padding-left: 1.5em; }


/* Portal grid */
.mp-body p:last-child {
margin-bottom: 0;
}
Β 
/* Lists */
.mp-body ul,
.mp-body ol {
margin: 0.25em 0 0.75em 1.4em;
padding: 0;
}
Β 
.mp-body li {
margin: 0.2em 0;
}
Β 
.mp-body li:empty {
display: none;
}
Β 
/* Nested lists */
.mp-body ul ul,
.mp-body ol ol,
.mp-body ul ol,
.mp-body ol ul {
margin-top: 0.25em;
margin-bottom: 0.25em;
}
Β 
/* Links inside body */
.mp-body a {
text-decoration: none;
}
Β 
.mp-body a:hover {
text-decoration: underline;
}
Β 
/* Tables only: horizontal scroll if needed */
.mp-body table {
display: block;
width: 100%;
max-width: 100%;
overflow-x: auto;
border-collapse: collapse;
}
Β 
/* Images */
.mp-body img {
max-width: 100%;
height: auto;
}
Β 
/* ============================================================
Β  PORTAL GRID
Β  ============================================================ */
Β 
#mp-portals {
#mp-portals {
Β  margin-top: 14px;
margin-top: 14px;
Β  border: 1px solid #a2a9b1;
border: 1px solid #a2a9b1;
Β  box-sizing: border-box;
box-sizing: border-box;
background: #ffffff;
}
}
#mp-portals-header {
#mp-portals-header {
Β  background: #dce3ee;
background: #dce3ee;
Β  border-bottom: 1px solid #a2a9b1;
border-bottom: 1px solid #a2a9b1;
Β  padding: 6px 12px;
padding: 6px 12px;
Β  font-weight: bold;
font-weight: 700;
Β  font-size: 0.95em;
font-size: 0.95em;
line-height: 1.4;
color: #202122;
}
}
.mp-portal-grid {
.mp-portal-grid {
Β  display: flex;
display: flex;
Β  flex-wrap: wrap;
flex-wrap: wrap;
Β  background: #ffffff;
background: #ffffff;
}
}
.mp-portal-cell {
.mp-portal-cell {
Β  flex: 1 1 15%;
flex: 1 1 15%;
Β  min-width: 100px; /* Reduce min-width for mobile safety */
min-width: 100px;
Β  border-right: 1px solid #eaecf0;
border-right: 1px solid #eaecf0;
Β  border-bottom: 1px solid #eaecf0;
border-bottom: 1px solid #eaecf0;
Β  padding: 10px 8px;
padding: 10px 8px;
Β  text-align: center;
text-align: center;
Β  font-size: 0.85em;
font-size: 0.9em;
Β  box-sizing: border-box;
line-height: 1.45;
box-sizing: border-box;
transition: background-color 0.15s ease-in-out;
}
}
.mp-portal-cell:hover { background: #eaf3fb; }
.mp-portal-cell a { color: #3366cc; font-weight: bold; display: block; text-decoration: none; }
.mp-portal-icon { font-size: 1.8em; display: block; margin-bottom: 4px; }
.mp-portal-desc { display: block; color: #54595d; font-size: 0.85em; margin-top: 2px; font-weight: normal; }


.mp-portal-cell:hover {
background: #eaf3fb;
}
.mp-portal-cell a {
color: #3366cc;
font-weight: 700;
display: block;
text-decoration: none;
}
.mp-portal-cell a:hover {
text-decoration: underline;
}
.mp-portal-icon {
display: block;
font-size: 1.8em;
line-height: 1;
margin-bottom: 4px;
}
.mp-portal-desc {
display: block;
margin-top: 2px;
color: #54595d;
font-size: 0.85em;
font-weight: 400;
line-height: 1.4;
}
/* Remove visual double borders at row/edge ends where possible */
.mp-portal-grid .mp-portal-cell:last-child {
border-right: none;
}


/* ============================================================
/* ============================================================
Β Β  RESPONSIVE DESIGN RULES
Β Β  RESPONSIVE DESIGN
Β Β  ============================================================ */
Β Β  ============================================================ */


/* Tablet and Smaller Desktop (up to 1000px) */
/* Tablet and smaller desktop */
@media screen and (max-width: 1000px) {
@media screen and (max-width: 1000px) {
Β  #mp-upper { Β 
#mp-upper {
Β  Β  display: block !important; /* Break the flex layout to stack cleanly */
display: block;
Β  Β  margin-bottom: 0 !important;
margin-bottom: 0;
Β  }
}
Β  #mp-left, #mp-right { Β 
Β 
Β  Β  width: 100% !important; Β 
#mp-left,
Β  Β  display: block !important; Β 
#mp-right {
Β  Β  margin-bottom: 15px !important;
width: 100%;
Β  }
display: block;
Β  .mp-portal-cell { Β 
margin-bottom: 15px;
Β  Β  flex: 1 1 30% !important; /* 3 items per row instead of 6 */
}
Β  }
Β 
.mp-portal-cell {
flex: 1 1 30%;
}
}
}


/* Standard Mobile Phones (up to 600px) */
/* Mobile phones */
@media screen and (max-width: 600px) {
@media screen and (max-width: 600px) {
Β  #mp-topbanner {
#mp-topbanner {
Β  Β  padding: 10px;
padding: 10px;
Β  Β  font-size: 0.95em;
font-size: 0.98em;
Β  }
}
Β  .mp-body {
Β 
Β  Β  padding: 8px 10px; /* Shrink padding slightly to maximize screen space */
.mp-h2 {
Β  }
padding: 6px 8px;
Β  .mp-portal-cell { Β 
font-size: 0.98em;
Β  Β  flex: 1 1 45% !important; /* 2 items per row */
}
Β  }
Β 
.mp-body {
padding: 8px 10px;
font-size: 0.95em;
}
Β 
.mp-body ul,
.mp-body ol {
margin-left: 1.2em;
}
Β 
.mp-portal-cell {
flex: 1 1 45%;
padding: 10px 6px;
}
}
}


/* Very Small Mobile Phones (up to 400px) */
/* Very small phones */
@media screen and (max-width: 400px) {
@media screen and (max-width: 400px) {
Β  .mp-portal-cell { Β 
.mp-portal-cell {
Β  Β  flex: 1 1 100% !important; /* Stack portals completely (1 item per row) */
flex: 1 1 100%;
Β  }
}
}
}

Revision as of 13:21, 29 July 2026

/* MediaWiki:Mainpage.css - Improved dedicated CSS for Main Page */

/* ============================================================
   MAIN PAGE ONLY SAFETY
   ============================================================ */

/* Hide the page title only on Main Page */
body.page-Main_Page #firstHeading,
body.page-Main_Page .firstHeading,
body.page-Main_Page .mw-page-title-main,
body.page-Main_Page .page-header__title {
	display: none !important;
}

/* General spacing cleanup for main page content */
body.page-Main_Page .mw-parser-output {
	font-size: 100%;
	line-height: 1.6;
}

/* ============================================================
   TOP BANNER
   ============================================================ */

#mp-topbanner {
	background: #cee0f2;
	border: 1px solid #a2a9b1;
	padding: 12px 16px;
	margin: 0 0 14px 0;
	text-align: center;
	font-size: 1.05em;
	line-height: 1.5;
	box-sizing: border-box;
}

/* ============================================================
   TWO-COLUMN LAYOUT
   ============================================================ */

#mp-upper {
	display: flex;
	flex-wrap: nowrap;
	gap: 15px;
	margin: 0 0 14px 0;
	align-items: flex-start;
}

#mp-left {
	flex: 1 1 55%;
	min-width: 0;
}

#mp-right {
	flex: 1 1 45%;
	min-width: 0;
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */

.mp-h2 {
	background: #cee0f2;
	border: 1px solid #a2a9b1;
	border-bottom: none;
	padding: 6px 10px;
	margin: 0;
	font-size: 1em;
	font-weight: 700;
	line-height: 1.4;
	color: #202122;
}

.mp-h2-yellow {
	background: #fef6e7;
}

.mp-h2-green {
	background: #ecf5ec;
}

.mp-h2-gray {
	background: #dce3ee;
}

/* ============================================================
   SECTION BODIES
   ============================================================ */

.mp-body {
	background: #ffffff;
	border: 1px solid #a2a9b1;
	border-top: none;
	padding: 10px 12px;
	margin: 0 0 12px 0;
	font-size: 0.95em;
	line-height: 1.65;
	color: #202122;
	box-sizing: border-box;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

/* Paragraphs */
.mp-body p {
	margin: 0 0 0.8em 0;
}

.mp-body p:last-child {
	margin-bottom: 0;
}

/* Lists */
.mp-body ul,
.mp-body ol {
	margin: 0.25em 0 0.75em 1.4em;
	padding: 0;
}

.mp-body li {
	margin: 0.2em 0;
}

.mp-body li:empty {
	display: none;
}

/* Nested lists */
.mp-body ul ul,
.mp-body ol ol,
.mp-body ul ol,
.mp-body ol ul {
	margin-top: 0.25em;
	margin-bottom: 0.25em;
}

/* Links inside body */
.mp-body a {
	text-decoration: none;
}

.mp-body a:hover {
	text-decoration: underline;
}

/* Tables only: horizontal scroll if needed */
.mp-body table {
	display: block;
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
}

/* Images */
.mp-body img {
	max-width: 100%;
	height: auto;
}

/* ============================================================
   PORTAL GRID
   ============================================================ */

#mp-portals {
	margin-top: 14px;
	border: 1px solid #a2a9b1;
	box-sizing: border-box;
	background: #ffffff;
}

#mp-portals-header {
	background: #dce3ee;
	border-bottom: 1px solid #a2a9b1;
	padding: 6px 12px;
	font-weight: 700;
	font-size: 0.95em;
	line-height: 1.4;
	color: #202122;
}

.mp-portal-grid {
	display: flex;
	flex-wrap: wrap;
	background: #ffffff;
}

.mp-portal-cell {
	flex: 1 1 15%;
	min-width: 100px;
	border-right: 1px solid #eaecf0;
	border-bottom: 1px solid #eaecf0;
	padding: 10px 8px;
	text-align: center;
	font-size: 0.9em;
	line-height: 1.45;
	box-sizing: border-box;
	transition: background-color 0.15s ease-in-out;
}

.mp-portal-cell:hover {
	background: #eaf3fb;
}

.mp-portal-cell a {
	color: #3366cc;
	font-weight: 700;
	display: block;
	text-decoration: none;
}

.mp-portal-cell a:hover {
	text-decoration: underline;
}

.mp-portal-icon {
	display: block;
	font-size: 1.8em;
	line-height: 1;
	margin-bottom: 4px;
}

.mp-portal-desc {
	display: block;
	margin-top: 2px;
	color: #54595d;
	font-size: 0.85em;
	font-weight: 400;
	line-height: 1.4;
}

/* Remove visual double borders at row/edge ends where possible */
.mp-portal-grid .mp-portal-cell:last-child {
	border-right: none;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

/* Tablet and smaller desktop */
@media screen and (max-width: 1000px) {
	#mp-upper {
		display: block;
		margin-bottom: 0;
	}

	#mp-left,
	#mp-right {
		width: 100%;
		display: block;
		margin-bottom: 15px;
	}

	.mp-portal-cell {
		flex: 1 1 30%;
	}
}

/* Mobile phones */
@media screen and (max-width: 600px) {
	#mp-topbanner {
		padding: 10px;
		font-size: 0.98em;
	}

	.mp-h2 {
		padding: 6px 8px;
		font-size: 0.98em;
	}

	.mp-body {
		padding: 8px 10px;
		font-size: 0.95em;
	}

	.mp-body ul,
	.mp-body ol {
		margin-left: 1.2em;
	}

	.mp-portal-cell {
		flex: 1 1 45%;
		padding: 10px 6px;
	}
}

/* Very small phones */
@media screen and (max-width: 400px) {
	.mp-portal-cell {
		flex: 1 1 100%;
	}
}