Module:Navbox timeline/styles.css: Difference between revisions
Appearance
AZMindroma (talk | contribs) Horizontal scrolling |
AZMindroma (talk | contribs) No edit summary |
||
| Line 2: | Line 2: | ||
width: 100%; | width: 100%; | ||
border-collapse: collapse; | border-collapse: collapse; | ||
table-layout: | table-layout: fixed; /* Keep this fixed for the wrapper */ | ||
max-width: 100%; | |||
} | } | ||
| Line 9: | Line 10: | ||
overflow-x: auto; /* Enable horizontal scrolling */ | overflow-x: auto; /* Enable horizontal scrolling */ | ||
overflow-y: visible; | overflow-y: visible; | ||
max-width: | width: 100%; | ||
max-width: 100%; | |||
box-sizing: border-box; | |||
} | } | ||
.timeline-table { | .timeline-table { | ||
min-width: | width: auto; /* Let it expand naturally */ | ||
min-width: 800px; /* Set a reasonable minimum */ | |||
border-collapse: collapse; | border-collapse: collapse; | ||
text-align: center; | text-align: center; | ||
white-space: nowrap; /* | white-space: nowrap; | ||
table-layout: auto; | |||
} | |||
/* Force the navbox to respect width constraints */ | |||
.navbox.timeline-container { | |||
max-width: 100%; | |||
overflow: hidden; | |||
} | |||
.navbox .timeline-wrapper { | |||
max-width: 100%; | |||
} | |||
.navbox .timeline-wrapper-cell { | |||
max-width: 100%; | |||
overflow-x: auto; | |||
display: block; /* This is key - makes it behave like a div */ | |||
} | } | ||
| Line 39: | Line 60: | ||
font-weight: normal; | font-weight: normal; | ||
min-width: 50px; | min-width: 50px; | ||
padding: 0.2em 0.25em; | |||
} | } | ||
| Line 47: | Line 69: | ||
} | } | ||
.timeline-month { | .timeline-month { | ||
background-color: #F8F8F8; | background-color: #F8F8F8; | ||
| Line 67: | Line 88: | ||
padding: 0 1em; | padding: 0 1em; | ||
vertical-align: middle; | vertical-align: middle; | ||
min-width: 100px; | |||
} | } | ||
| Line 72: | Line 94: | ||
background-color: #E0E0E0; | background-color: #E0E0E0; | ||
color: inherit; | color: inherit; | ||
} | } | ||
| Line 79: | Line 100: | ||
color: inherit; | color: inherit; | ||
font-weight: bold; | font-weight: bold; | ||
vertical-align: middle; | vertical-align: middle; | ||
font-size: 0.9em; | font-size: 0.9em; | ||
min-width: 40px; | min-width: 40px; | ||
padding: 0.2em 0.25em; | |||
word-wrap: break-word; | word-wrap: break-word; | ||
overflow-wrap: break-word; | overflow-wrap: break-word; | ||
} | } | ||
.timeline-item:hover { | .timeline-item:hover { | ||
background-color: #B0B0B0; | background-color: #B0B0B0; | ||
cursor: pointer; | cursor: pointer; | ||
} | } | ||
/* Responsive adjustments */ | /* Responsive adjustments */ | ||
@media (max-width: 768px) { | @media (max-width: 768px) { | ||
.timeline-table { | |||
min-width: 600px; /* Smaller minimum for mobile */ | |||
} | |||
.timeline-month { | .timeline-month { | ||
font-size: 0.7em; | font-size: 0.7em; | ||
| Line 142: | Line 140: | ||
} | } | ||
.timeline- | .timeline-label { | ||
min-width: 80px; | |||
} | } | ||
} | } | ||
Revision as of 17:49, 9 June 2025
.timeline-wrapper {
width: 100%;
border-collapse: collapse;
table-layout: fixed; /* Keep this fixed for the wrapper */
max-width: 100%;
}
.timeline-wrapper-cell {
padding: 0;
overflow-x: auto; /* Enable horizontal scrolling */
overflow-y: visible;
width: 100%;
max-width: 100%;
box-sizing: border-box;
}
.timeline-table {
width: auto; /* Let it expand naturally */
min-width: 800px; /* Set a reasonable minimum */
border-collapse: collapse;
text-align: center;
white-space: nowrap;
table-layout: auto;
}
/* Force the navbox to respect width constraints */
.navbox.timeline-container {
max-width: 100%;
overflow: hidden;
}
.navbox .timeline-wrapper {
max-width: 100%;
}
.navbox .timeline-wrapper-cell {
max-width: 100%;
overflow-x: auto;
display: block; /* This is key - makes it behave like a div */
}
.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;
padding: 0.2em 0.25em;
}
.timeline-decade {
min-width: 80px;
font-weight: bold;
background-color: #E8E8E8;
}
.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;
min-width: 100px;
}
.timeline-blank {
background-color: #E0E0E0;
color: inherit;
}
.timeline-item {
background-color: #C0C0C0;
color: inherit;
font-weight: bold;
vertical-align: middle;
font-size: 0.9em;
min-width: 40px;
padding: 0.2em 0.25em;
word-wrap: break-word;
overflow-wrap: break-word;
}
.timeline-item:hover {
background-color: #B0B0B0;
cursor: pointer;
}
/* Responsive adjustments */
@media (max-width: 768px) {
.timeline-table {
min-width: 600px; /* Smaller minimum for mobile */
}
.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-label {
min-width: 80px;
}
}