Skip to content

Commit

Permalink
feat: add alignment options for feature list and roadmap components
Browse files Browse the repository at this point in the history
  • Loading branch information
jeangovil committed Jul 13, 2023
1 parent cfae78a commit 4053a0b
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,32 @@
position: relative;
}

.mdx-feature-list--top-aligned {
}

.mdx-feature-list--bottom-aligned {
@include utils.responsive('lg', 'up') {
.mdx-feature-list__feature {
min-height: 332px;
}

.mdx-feature-list__feature-description {
flex: 1 0;
display: flex;
flex-direction: column;
justify-content: flex-end;
}
}
}

.mdx-feature-list--top-aligned {
@include utils.responsive('lg', 'up') {
.mdx-feature-list__feature-description {
margin-top: 136px;
}
}
}

.mdx-feature-list__title {
padding: 24px 0;
}
Expand Down Expand Up @@ -41,10 +67,6 @@
}

.mdx-feature-list__feature-description {
flex: 1 0;
display: flex;
flex-direction: column;
justify-content: flex-end;
}

.mdx-feature-list__extra {
Expand All @@ -56,7 +78,6 @@
.mdx-feature-list__feature {
padding: 1rem;
position: relative;
min-height: 332px;
}

.mdx-feature-list__feature-inner {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,26 @@ export type FeatureListProps = Omit<
> & {
title?: React.ReactNode
features?: Feature[]
alignment?: 'bottom' | 'top'
}

export const FeatureList: React.FC<FeatureListProps> = ({
title = 'Features',
alignment = 'bottom',
features = [],
className,
children,
...props
}) => {
return (
<div className={clsx(className, 'mdx-feature-list')} {...props}>
<div
className={clsx(
className,
'mdx-feature-list',
`mdx-feature-list--${alignment}-aligned`,
)}
{...props}
>
<Typography
variant="h6"
component="h1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@

.mdx-roadmap__timeline-item {
width: 236px;
min-height: 308px;
gap: 1rem;
flex: 0 0 auto;
display: flex;
flex-direction: column;
justify-content: space-between;
padding-bottom: 23px;
border-bottom: 1px solid rgb(var(--lsd-border-primary));
scroll-snap-align: start !important;
Expand Down Expand Up @@ -89,6 +87,16 @@
}
}

.mdx-roadmap--top-aligned {
}

.mdx-roadmap--bottom-aligned {
.mdx-roadmap__timeline-item {
min-height: 308px;
justify-content: space-between;
}
}

@include utils.responsive('lg', 'down') {
.mdx-roadmap__header {
flex-direction: column;
Expand All @@ -104,7 +112,6 @@

.mdx-roadmap__timeline-item {
width: 204px;
min-height: 306px;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ export type RoadmapProps = Omit<
title: React.ReactNode
description?: React.ReactNode
timeline?: TimelineItem[]
alignment?: 'top' | 'bottom'
}

export const Roadmap: React.FC<RoadmapProps> = ({
title,
description,
alignment = 'bottom',
timeline = [],
className,
children,
Expand All @@ -48,7 +50,14 @@ export const Roadmap: React.FC<RoadmapProps> = ({
}

return (
<div className={clsx(className, 'mdx-roadmap')} {...props}>
<div
className={clsx(
className,
'mdx-roadmap',
`mdx-roadmap--${alignment}-aligned`,
)}
{...props}
>
<div className="mdx-roadmap__header">
<Typography component="h2" variant="h6">
{title}
Expand Down

0 comments on commit 4053a0b

Please sign in to comment.