@use "sass:math"; /* variables specific to current element */ $timeline-item-horiz-padding: $timeline-item-horiz-padding-global; $timeline-item-vert-padding: $timeline-item-vert-padding-global; $timeline-item-content-negative-margin: $timeline-item-content-negative-margin-global; .#{$namespace}timeline { /* Save root element context for easy access if nesting is needed */ $self: &; /* properties of current element + media queries */ @include spacer-component-stack("md"); /* Pseudo Elements */ &::before { } &::after { } /* Include elements that are linked to the current element but have to reside at the root level of the stylesheet (e.g: keyframes) */ @at-root { } /* children - write selector in full in comments in order to facilitate search */ // timeline__item &__item { // follows same logic as parent @include spacer-component-inset-horiz-greater("md", "lg"); position: relative; z-index: z("zero"); display: block; &::before { content: ""; width: 2px; position: absolute; z-index: z("low"); bottom: 100%; height: $timeline-item-vert-padding*3; left: $timeline-item-horiz-padding + $section-item-col-date-width-global + $section-item-horiz-margin-global + math.div($section-item-col-dot-width-global, 2); transform: translateX(-50%) translateY($timeline-item-vert-padding); background-color: map-deep-get($token-color-brand-map, "secondary", "30"); } &:first-child { &::before { height: $timeline-item-vert-padding; left: $timeline-item-horiz-padding + $section-item-col-date-width-global + $section-item-horiz-margin-global + math.div($section-item-col-dot-width-global, 2); } } &:not(:last-child) { .#{$namespace}sectionItem.-isTimelineItem:last-child:only-child { .#{$namespace}sectionItem__inner { .#{$namespace}sectionItem__innerCol { &.-dot { &::before { bottom: -($timeline-item-vert-padding) !important; } } } } } } &:last-child { .#{$namespace}sectionTitle { &::before {opacity: 0;} } .#{$namespace}sectionItem.-isTimelineItem:last-child { .#{$namespace}sectionItem__inner { .#{$namespace}sectionItem__innerCol { &.-dot { &::before {bottom: 50%;} } } } } #{$self}__collapseInner { position: relative; &::before { content: ""; width: $border-width*2; position: absolute; z-index: z("low"); bottom: 100%; height: $timeline-item-vert-padding; left: $section-item-col-date-width-global + $section-item-horiz-margin-global + math.div($section-item-col-dot-width-global, 2); transform: translateX(-50%) translateY($timeline-item-vert-padding); background-color: map-deep-get($token-color-brand-map, "secondary", "30"); } } &.-empty { &::before { transform: translateX(-50%) translateY(0); height: $timeline-item-vert-padding*2; } } } .#{$namespace}sectionTitle.-isTimelineItem, .#{$namespace}sectionItem.-isTimelineItem { margin-left: -($timeline-item-content-negative-margin); margin-right: -($timeline-item-content-negative-margin); } .#{$namespace}sectionTitle.-isTimelineItem { padding-left: map-deep-get($token-spacer-unit-map, "8"); padding-right: map-deep-get($token-spacer-unit-map, "8"); } } &__collapseInner { padding-top: $timeline-item-vert-padding; } /* modifiers */ // timeline -firstItemNoLine &.-firstItemNoLine { // follows same logic as base element #{$self}__item:first-of-type { &::before { content: none; } } } &.-hasEmptyItems { display: flex; flex-direction: column; height: 100%; } /* random parent element */ /* * * Syntax : .randomParentElt & {} * */ /* Pseudo Classes */ &:hover { @media (hover: hover) { } } &:focus { } &:active { } &:focus, &:active { } }