Last active
January 7, 2023 23:28
-
-
Save mattConn/4dd2f082733a6eaac81bdda1c5e52f6b to your computer and use it in GitHub Desktop.
Vertical timeline component. Example: https://mattconn.github.io/timeline/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* timeline event styles */ | |
.timeline-event { | |
display: flex; | |
} | |
.timeline-event .timeline-event_copy { | |
padding: 0 1em; | |
} | |
.timeline-event .timeline-event_copy.current { | |
background-color: #dedef9; | |
} | |
/* | |
Making this shape: | |
| | |
201x |-- Event | |
| | |
There is a vertical line, and a horizontal line per event. | |
*/ | |
/* vertical line */ | |
.timeline-event .timeline-event_lines { | |
border-left: 3px solid black; | |
} | |
/* horizontal line */ | |
.timeline-event .timeline-event_lines div { | |
border-bottom: solid 1px black; | |
padding: 1em; | |
} | |
/* end timeline event styles */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class = "timeline-event"> | |
<div class="timeline-event_copy"> | |
<h1>2016</h1> | |
</div> | |
<!-- vertical and horizontal lines --> | |
<div class="timeline-event_lines"> | |
<div> | |
</div> | |
</div> | |
<div class="timeline-event_copy"> | |
<h1>Event Title</h1> | |
<p>Event description.</p> | |
<p>More event copy.</p> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment