@use "sass:math"; /* variables specific to current element */ $grid-column-junction: 6; $grid-column-start: math.div($grid-columns,$grid-columns); $grid-column-end: $grid-columns + 1; $timeline-story-col-padding: math.div(($grid-columns - (($grid-columns - ($grid-column-junction + 1)) * 2)) , $grid-columns) * 100%; $timeline-gap: $grid-gutter-width; $timeline-big-margin-top: 280px; $timeline-row-spacer: map-deep-get($token-spacer-stack-max-map, "xxl"); .#{$namespace}timelineStory { /* Save root element context for easy access if nesting is needed */ $self: &; /* properties of current element + media queries */ @include media-breakpoint-up("md") { display: grid; grid-template-columns: repeat(#{$grid-columns}, 1fr); grid-auto-flow: dense; gap: $timeline-gap; } /* 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 */ // timelineStory__row &__row { position: relative; z-index: z("zero"); margin-bottom: $timeline-row-spacer; display: flex; &::before { content: ""; width: $border-width*2; @include custom-prop-fallback("background-color", "sys-color-border-primary-subtle"); position: absolute; top: 0 !important; bottom: -$timeline-row-spacer !important; left: map-deep-get($token-spacer-inline-map, "sm"); transform: translateX(-50%); } &:first-of-type { &::before { @include fluid-prop("top", $min_width, $max_width, $h1-page-cover-font-size-min*0.5, $h1-page-cover-font-size*0.5, true); } + :last-of-type { &::before { @include media-breakpoint-up("md") { margin-top: -$timeline-big-margin-top; } } } } &:last-of-type { margin-bottom: 0; &:nth-of-type(odd) { //background-color: lightblue; &::before { content: ""; @include fluid-prop("height", $min_width, $max_width, $h1-page-cover-font-size-min, $h1-page-cover-font-size, true); top: -$timeline-gap*0.5 - $border-width*2 !important; bottom: auto !important; @include media-breakpoint-up("md") { top: 0 !important; transform: translateY(-50%); left: -$timeline-gap*0.5 - $border-width; } } } &:nth-of-type(even) { //background-color: lightgreen; &::before { @include media-breakpoint-up("md") { content: ""; bottom: 0; @include fluid-prop("top", $min_width, $max_width, $h1-page-cover-font-size-min*0.5, $h1-page-cover-font-size*0.5, true); height: $timeline-big-margin-top; } } } &::before { content: none; } } &:nth-last-of-type(2) { &::before { bottom: -$timeline-row-spacer * 1.5 !important; } &:nth-of-type(odd) { //background-color: pink; &::before { @include media-breakpoint-up("md") { content: none; } } } &:nth-of-type(even) { //background-color: gold; &::before { @include media-breakpoint-up("md") { bottom: -$timeline-gap !important; } } } } &:nth-last-of-type(3) { &:nth-of-type(odd) { //background-color: coral; &::before { bottom: -$timeline-row-spacer !important; } } } // follows same logic as parent @include media-breakpoint-up("md") { margin-bottom: 0; grid-column-start: $grid-column-start; grid-column-end: $grid-column-junction + 1; position: relative; &::before { top: 0; bottom: -$timeline-gap*2 !important; left: -$timeline-gap*0.5; transform: translateX(-50%); } &:nth-of-type(odd) { grid-column-start: $grid-column-junction + 1; grid-column-end: $grid-column-end; padding-left: calc(#{($timeline-story-col-padding)} + #{$grid-gutter-width-xs*0.5}); &:first-of-type { #{$self}__indicator { top: 0; left: -$timeline-gap*0.5 - $border-width; } } } &:nth-of-type(even) { margin-top: $timeline-big-margin-top; text-align: right; padding-right: calc(#{($timeline-story-col-padding)} + #{$grid-gutter-width-xs*0.5}); #{$self}__indicator { left: auto; right: -$timeline-gap*0.5; flex-direction: row-reverse; } &:nth-last-of-type(2) { &::before { bottom: -$timeline-gap*2; } } &::before { left: auto; right: -$timeline-gap*0.5 - $border-width*2; margin-top: -$timeline-big-margin-top; } } &:nth-of-type(2) { &::before { margin-top: -$timeline-big-margin-top + $timeline-gap; } } } } &__indicator { display: flex; align-items: center; @include fluid-height($min_width, $max_width, $h1-page-cover-font-size-min, $h1-page-cover-font-size, true); margin-right: map-deep-get($token-spacer-inline-map, "md"); @include media-breakpoint-up("md") { position: absolute; top: 0; left: -$timeline-gap*0.5; width: $timeline-story-col-padding; margin-right: 0; } &::before { @include media-breakpoint-up("md") { content: ""; height: $border-width*2; @include custom-prop-fallback("background-color", "sys-color-border-primary-subtle"); width: map-deep-get($token-sizes-unit-map, "32"); max-width: map-deep-get($token-sizes-unit-map, "32"); } } &::after { content: ""; width: map-deep-get($token-sizes-unit-map, "16"); height: map-deep-get($token-sizes-unit-map, "16"); @include custom-prop-fallback("background-color", "sys-color-border-primary-subtle"); border-radius: map-deep-get($token-radius-map, "circle"); flex-shrink: 0; transform: translateY(25%); @include media-breakpoint-up("md") { transform: none; } } } /* modifiers */ // timelineStory -altStyle &.-altStyle { // follows same logic as base element } /* random parent element */ /* * * Syntax : .randomParentElt & {} * */ /* Pseudo Classes */ &:hover { @media (hover: hover) { } } &:focus { } &:active { } &:focus, &:active { } }