jareika_Simple-Timeline/styles.css
Jareika f2bef14f20 New timeline design
Horizontal timeline added with bases support.
2026-01-02 18:11:41 +01:00

354 lines
No EOL
7.8 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.tl-wrapper.tl-cross-mode {
display: grid;
gap: 20px;
}
.tl-row {
width: 100%;
margin: 0;
}
.tl-grid {
display: grid;
align-items: center;
column-gap: 0;
row-gap: 0;
}
/* Grid layout:
We keep DOM order (media first, then box) so the adjacency hover selector
still works. We only swap the visual placement via grid areas. */
.tl-grid.has-media {
grid-template-columns: var(--tl-media-w, 200px) 1fr;
grid-template-areas: "media box";
}
.tl-row.tl-align-right .tl-grid.has-media {
grid-template-columns: 1fr var(--tl-media-w, 200px);
grid-template-areas: "box media";
}
.tl-grid.no-media {
grid-template-columns: 1fr;
grid-template-areas: "box";
}
/* Assign areas */
.tl-media {
grid-area: media;
}
/* Card / calloutlike box */
.tl-box.callout {
grid-area: box;
position: relative;
box-sizing: border-box;
padding: 10px 12px;
margin: 0; /* neutralize default callout margin from the theme */
background: var(--tl-bg, var(--background-primary));
border: 1px solid var(--tl-accent, var(--background-modifier-border));
box-shadow: 0 1px 0 rgba(0,0,0,.04), 1px 0 0 rgba(0,0,0,.04);
border-radius: 10px;
display: flex;
flex-direction: column;
overflow: hidden;
transition:
background-color .15s ease,
border-color .15s ease,
box-shadow .15s ease;
}
/* Image */
.tl-media {
position: relative;
overflow: hidden;
border-radius: 8px;
background: var(--background-modifier-border);
z-index: 2; /* in doubt, sit above the box when they overlap slightly */
}
/* Default: image left -> box is on the right, so we cut the LEFT edge */
.tl-row:not(.tl-align-right) .tl-box.callout.has-media {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
/* Image right -> box is on the left, so we cut the RIGHT edge */
.tl-row.tl-align-right .tl-box.callout.has-media {
border-right: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.tl-box.callout.no-media {
border-radius: 10px;
}
.tl-box .tl-title,
.tl-box .tl-date {
margin: 0 0 6px;
}
/* Grundstil für Timeline-Heading, entkoppelt vom Theme */
.tl-box .tl-title.tl-title-colored,
.tl-box .tl-date.tl-date-colored {
position: relative;
display: inline-block;
border: 0 !important;
border-bottom: 0 !important;
box-shadow: none !important;
background: none !important;
background-image: none !important;
}
/* H1 line */
.tl-box .tl-title.tl-title-colored::after {
content: "";
pointer-events: none;
position: absolute;
left: 0;
bottom: -0.12em;
height: 0.12em;
width: 100%;
background-image: linear-gradient(
to right,
currentColor 0%,
currentColor 20%,
transparent 100%
);
opacity: 0.95;
}
/* H4 / date line */
.tl-box .tl-date.tl-date-colored::after {
content: "";
pointer-events: none;
position: absolute;
left: 0;
bottom: -0.24em;
height: 0.20em;
width: 45%;
background-image: linear-gradient(
to right,
currentColor 0%,
currentColor 1%,
transparent 100%
);
opacity: 0.95;
}
/* Summary */
.tl-box .tl-summary {
position: relative;
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
color: inherit;
text-decoration: none;
line-height: var(--tl-summary-lh, 1.4);
display: -webkit-box !important;
-webkit-box-orient: vertical !important;
word-break: break-word;
}
.tl-box .tl-summary.tl-clamp {
max-height: calc(var(--tl-summary-lines, 7) * var(--tl-summary-lh, 1.4) * 1em);
overflow: hidden;
}
/* Hover */
.tl-media:hover + .tl-box.callout.has-media,
.tl-box.callout:hover {
background: var(
--tl-hover,
var(--interactive-accent, var(--tl-bg, var(--background-primary)))
);
border-color: var(--tl-accent, var(--background-modifier-border));
box-shadow: 0 1px 0 rgba(0,0,0,.06), 1px 0 0 rgba(0,0,0,.06);
}
/* Click / popover area only over image or box */
.tl-hover-anchor.internal-link {
position: absolute;
inset: 0;
z-index: 5;
text-decoration: none !important;
color: transparent !important;
background: transparent;
cursor: pointer;
}
/* =========================================
Horizontal timeline (timeline-h)
========================================= */
.tl-h-scroller {
--tl-h-col-w: 600px;
--tl-h-gap: 0px; /* cards touch */
--tl-h-stack-gap: 26px;
overflow-x: auto;
overflow-y: visible;
-webkit-overflow-scrolling: touch;
padding-bottom: 8px;
}
.tl-h-content.tl-horizontal.tl-h-mixed {
display: flex;
flex-direction: row;
align-items: stretch;
gap: var(--tl-h-gap, 0px);
}
.tl-h-content.tl-horizontal.tl-h-stacked {
display: flex;
flex-direction: column;
gap: var(--tl-h-stack-gap, 26px);
}
.tl-h-item {
flex: 0 0 auto;
width: var(--tl-h-col-w, 600px);
padding-left: 0 !important;
padding-right: 0 !important;
}
.tl-horizontal .tl-row {
width: auto !important;
}
/* Ensure fixed card width */
.tl-h-item .tl-grid.no-media {
grid-template-columns: var(--tl-h-col-w, 600px);
}
.tl-h-item .tl-grid.has-media {
grid-template-columns:
var(--tl-media-w, 200px)
max(160px, calc(var(--tl-h-col-w, 600px) - var(--tl-media-w, 200px)));
}
.tl-h-item.tl-align-right .tl-grid.has-media {
grid-template-columns:
max(160px, calc(var(--tl-h-col-w, 600px) - var(--tl-media-w, 200px)))
var(--tl-media-w, 200px);
}
/* Join styling (ONLY when JS adds join-classes) */
.tl-h-item.tl-h-join-left-box .tl-box.callout {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.tl-h-item.tl-h-join-right-box .tl-box.callout {
border-right: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
/* stacked grid per timeline row */
.tl-h-timeline {
display: block;
}
.tl-h-row {
display: grid;
grid-template-columns: repeat(var(--tl-h-cols, 1), var(--tl-h-col-w, 600px));
column-gap: var(--tl-h-gap, 0px);
row-gap: 12px;
align-items: start;
}
.tl-h-slot {
grid-column-start: var(--tl-h-col);
display: flex;
flex-direction: column;
gap: 12px;
}
/* =========================================
Responsive behaviour (tablet / mobile)
========================================= */
@media (max-width: 900px) {
.tl-horizontal {
--tl-h-col-w: 420px;
--tl-h-gap: 0px;
}
.tl-wrapper.tl-cross-mode {
gap: 16px;
}
.tl-wrapper.tl-cross-mode .tl-row {
padding-left: 16px !important;
padding-right: 16px !important;
display: flex;
justify-content: center;
}
.tl-wrapper.tl-cross-mode .tl-grid {
grid-template-columns: 1fr !important;
justify-items: stretch;
width: 100%;
max-width: 560px;
row-gap: 0;
}
.tl-wrapper.tl-cross-mode .tl-grid.has-media {
grid-template-areas:
"media"
"box" !important;
}
.tl-wrapper.tl-cross-mode .tl-grid.no-media {
grid-template-areas: "box" !important;
}
.tl-wrapper.tl-cross-mode .tl-media {
width: 100% !important;
max-width: 560px;
height: auto !important;
border-radius: 10px 10px 0 0;
border: none;
margin-bottom: -6px;
background: transparent;
}
.tl-wrapper.tl-cross-mode .tl-media img {
width: 100%;
height: auto !important;
object-fit: cover;
display: block;
border-radius: 10px 10px 0 0;
}
.tl-wrapper.tl-cross-mode .tl-box.callout {
width: 100%;
max-width: 560px;
}
.tl-wrapper.tl-cross-mode .tl-box.callout.has-media {
height: auto !important;
border-radius: 0 0 10px 10px;
border: 1px solid var(--tl-accent, var(--background-modifier-border));
border-top: none;
margin-top: 0;
}
.tl-wrapper.tl-cross-mode .tl-row.tl-align-right .tl-box.callout.has-media,
.tl-wrapper.tl-cross-mode .tl-row:not(.tl-align-right) .tl-box.callout.has-media {
border: 1px solid var(--tl-accent, var(--background-modifier-border));
border-top: none;
border-radius: 0 0 10px 10px;
}
.tl-wrapper.tl-cross-mode .tl-box.callout.no-media {
width: 100%;
max-width: 560px;
height: auto !important;
border-radius: 10px;
}
}