Skip to content

Instantly share code, notes, and snippets.

@kingisaac95
Created June 24, 2022 13:42
Show Gist options
  • Save kingisaac95/33cb5df4729aaa288011452b4a102ee0 to your computer and use it in GitHub Desktop.
Save kingisaac95/33cb5df4729aaa288011452b4a102ee0 to your computer and use it in GitHub Desktop.
Timeline Capsule Component CSS
const borderStyle = css`
border: solid 1px ${({ theme }) => theme.colors.neutral._40};
`;
export const $TimelineCapsule = styled.div`
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
font-size: ${({ theme }) => theme.font.size.body.sm};
height: 50px;
.event-title,
.event-time {
margin: 0;
}
.event-title {
margin-left: 32px;
}
.event-time {
color: ${({ theme }) => theme.colors.neutral._60};
}
:before {
content: '•';
position: absolute;
left: 0;
bottom: 3px;
color: ${({ theme }) => theme.colors.neutral._40};
font-size: ${({ theme }) => theme.font.size.heading.lg};
}
:only-child:after {
display: none;
}
:first-child:after {
content: '';
position: absolute;
top: 50%;
left: 6px;
height: 25px;
${borderStyle};
}
:after {
content: '';
position: absolute;
top: 0;
left: 6px;
height: 50px;
${borderStyle};
}
:last-child:after {
content: '';
position: absolute;
bottom: 50%;
left: 6px;
height: 25px;
${borderStyle};
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment