Module:Navbox timeline/styles.css

Revision as of 17:31, 9 June 2025 by AZMindroma (talk | contribs) (Horizontal scrolling)
.timeline-wrapper { 
	width: 100%;
	border-collapse: collapse;
	table-layout: auto; /* Changed from fixed */
}

.timeline-wrapper-cell {
	padding: 0;
	overflow-x: auto; /* Enable horizontal scrolling */
	overflow-y: visible;
	max-width: 100vw; /* Prevent viewport overflow */
}

.timeline-table {
	min-width: 100%; /* Allow table to be wider than container */
	border-collapse: collapse;
	text-align: center;
	white-space: nowrap; /* Prevent text wrapping */
}

.timeline-row > * {
	border-style: solid;
	border-color: #FDFDFD;
	border-width: 2px 2px 0 0;
}

.timeline-row:first-child > * {
	border-top-width: 0;
}

.timeline-row > :last-child {
	border-right-width: 0;
}

.timeline-decade,
.timeline-year {
	background-color: #F0F0F0;
	color: inherit;
	font-weight: normal;
	min-width: 50px;
}

.timeline-decade {
	min-width: 80px;
	font-weight: bold;
	background-color: #E8E8E8;
}

/* Month-specific styling */
.timeline-month {
	background-color: #F8F8F8;
	color: inherit;
	font-weight: normal;
	font-size: 0.75em;
	padding: 0.1em 0.2em;
	border-left: 1px solid #E0E0E0;
	min-width: 30px;
}

.timeline-month:first-child {
	border-left: none;
}

.timeline-label {
	text-align: center;
	font-weight: normal;
	padding: 0 1em;
	vertical-align: middle;
}

.timeline-blank {
	background-color: #E0E0E0;
	color: inherit;
	position: relative;
}

.timeline-item {
	background-color: #C0C0C0;
	color: inherit;
	font-weight: bold;
	position: relative;
	vertical-align: middle;
	font-size: 0.9em;
	min-width: 40px;
	word-wrap: break-word;
	overflow-wrap: break-word;
	hyphens: auto;
}

.timeline-decade,
.timeline-year,
.timeline-item {
	padding: 0.2em 0.25em;
}

/* Hover effects for better interactivity */
.timeline-item:hover {
	background-color: #B0B0B0;
	cursor: pointer;
}

/* Add subtle gradients for better visual appeal */
.timeline-item {
	background: linear-gradient(to bottom, #C8C8C8, #B8B8B8);
}

.timeline-item:hover {
	background: linear-gradient(to bottom, #B8B8B8, #A8A8A8);
}

/* Improve borders for month view */
.timeline-table .timeline-month + .timeline-month {
	border-left: 1px solid #D0D0D0;
}

/* Add visual separation between years when showing months */
.timeline-year[colspan] {
	border-bottom: 2px solid #C0C0C0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.timeline-month {
		font-size: 0.7em;
		padding: 0 0.05em;
		min-width: 25px;
	}
	
	.timeline-decade,
	.timeline-year,
	.timeline-item {
		padding: 0.1em 0.15em;
		font-size: 0.9em;
	}
	
	.timeline-year {
		min-width: 40px;
	}
	
	.timeline-decade {
		min-width: 60px;
	}
	
	.timeline-wrapper-cell {
		max-width: calc(100vw - 20px);
	}
}