Skip to content

Commit

Permalink
feat(step): support horizontal content
Browse files Browse the repository at this point in the history
  • Loading branch information
lubber-de authored Nov 8, 2024
1 parent 20747a2 commit 139f225
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/definitions/elements/step.less
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,24 @@
&:last-child {
flex: 0;
}
& .content {
margin-top: @circularStepContentMarginTop;
padding: @circularStepContentPadding;
&.center.aligned {
margin-top: @circularStepContentCenterAlignedMarginTop;
& .title {
padding: @circularStepContentPadding;
margin-left: @circularStepContentCenterAlignedMarginLeft;
background: @circularStepContentCenterAlignedBackground;
}
}
&.bottom.aligned {
margin-top: @circularStepContentBottomAlignedMarginTop;
}
&:not(.aligned) .title + .description {
margin-top: @circularStepContentDescriptionDistance;
}
}
}
}

Expand Down Expand Up @@ -265,6 +283,14 @@
}
}
}
@supports selector(:has(.f)) {
.ui.circular.steps:not(.vertical) .step:last-child:has(.content) {
flex: 1;
}
.ui.circular.steps:not(.vertical) .step:last-child:has(.center.aligned.content) {
background: none;
}
}
}

& when (@variationStepOrdered) {
Expand Down Expand Up @@ -821,6 +847,9 @@
& .step:not(.active):not(.completed)::before {
border-color: @invertedTextColor;
}
& .step .center.aligned.content .title {
background: @invertedCircularStepContentCenterAlignedBackground;
}
}
&:not(.ordered) .step:not(.active):not(.completed)::after {
background: @invertedTextColor;
Expand Down
10 changes: 10 additions & 0 deletions src/themes/default/elements/step.variables
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@
@circularStepCompletedIconLineHeight: 1em;
@circularStepCompletedIconDistance: calc(-@circularStepRingSize + ((@circularStepRingSize / 2) / 2) + (@circularStepBorderWidth / 2));

@circularStepContentMarginTop: -1.5em;
@circularStepContentCenterAlignedMarginTop: -0.65em;
@circularStepContentBottomAlignedMarginTop: 0.5em;
@circularStepContentHorizontalPadding: 0.5em;
@circularStepContentPadding: 0 @circularStepContentHorizontalPadding;
@circularStepContentCenterAlignedMarginLeft: -@circularStepContentHorizontalPadding;
@circularStepContentDescriptionDistance: 0.5em;
@circularStepContentCenterAlignedBackground: @white;
@invertedCircularStepContentCenterAlignedBackground: @black;

@verticalCircularStepPadding: 3em;
@verticalCircularStepContentPadding: 3.5em;
@verticalCircularStepLineDistance: calc(@circularStepRingSize / unit(@circularStepBorderWidth));
Expand Down

0 comments on commit 139f225

Please sign in to comment.