ArticleTemplates/assets/scss/modules/_key-events.scss (153 lines of code) (raw):
.key-events {
background: color(brightness-96);
border-bottom: 1px solid color(tone-sandy-light);
border-top: none;
margin: 0 auto;
max-width: 1200px;
overflow: hidden;
padding: base-px(1, 1, 0, 1);
position: relative;
transition: padding .6s;
&--0 {
display: none;
}
@include mq($from: col2) {
padding-top: base-px(1);
border: 1px solid color(tone-sandy-light);
}
&__title {
font: 600 1.8rem $egyptian-display;
margin-bottom: base-px(1);
@include mq($from: col2) {
float: left;
width: cols($base-3, 4, 1);
}
@include mq($from: col3) {
width: cols($base-4, 5, 1);
}
@include mq($from: col4) {
float: left;
margin-right: 20px;
width: 220px;
}
}
&__counter {
opacity: 1;
transition: opacity .2s;
}
&__toggle {
border: 1px solid color(brightness-60);
border-radius: 50%;
height: 32px;
position: absolute;
right: 6px;
top: 12px;
width: 32px;
&-icon {
left: 50%;
position: absolute;
top: 50%;
transform: translateX(-50%) translateY(-50%);
transition: transform .4s;
&::before {
color: color(brightness-60);
font-size: 1.7rem;
}
}
}
&__list {
@include mq($from: col2) {
float: left;
width: cols($base-3, 8);
}
@include mq($from: col3) {
width: cols($base-4, 11);
}
@include mq($from: col4) {
width: 620px;
}
}
&--expanded {
padding-bottom: base-px(1.5);
.key-events {
&__toggle-icon {
transform: translateX(-50%) translateY(-50%) rotate(180deg);
}
&__counter {
opacity: 0;
}
}
}
&--0 {
.key-events__toggle {
display: none;
}
}
}
.key-event {
max-height: 0;
opacity: 0;
padding: base-px(0, .5, 0, 1);
position: relative;
transition: color .6s;
width: 90%;
// Create bullet point for events
&::before {
background: #bdbdbd !important;
border-radius: 50%;
content: '';
display: block;
height: 10px;
left: -5px;
position: absolute;
top: 4px;
width: 10px;
}
// Create timeline bar for events
&::after {
background: #bdbdbd;
content: '';
height: 100%;
left: -1px;
position: absolute;
top: 4px;
width: 1px;
}
// only shown when key-events--expanded & first child always visible
.key-events--expanded &,
&:first-child {
max-height: 300px;
opacity: 1;
}
&__time {
color: color(brightness-7);
display: block;
font: 600 1.5rem $egyptian-display;
}
// Create tick marks for first child instead of dot, and position start of timeline
&:first-child {
&::before {
height: 1px;
left: -1px;
top: 8px;
width: 7px;
}
&::after {
top: 8px;
}
}
// Create tick marks for last child instead of dot and end the timeline, and position end of timeline
&:last-child {
&::before {
height: 1px;
left: -1px;
top: 8px;
width: 7px;
}
&::after {
height: 9px;
top: 0;
}
}
&__link,
&__link h2 {
display: block;
font: normal 1.6rem $egyptian-text;
padding: base-px(.5, 0, 1, 0);
}
}