Skip to content

Commit e604de5

Browse files
committed
feat: introduce line overhang configuration
1 parent 74cc33e commit e604de5

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/components/Timeline.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
:where(.timeline) {
22
--line-width: 0.2rem;
33
--line-color: black;
4+
--line-overhang: 1rem;
45
--marker-size: 1rem;
56
--marker-color: var(--line-color);
67
--marker-radius: 50%;
@@ -12,11 +13,9 @@
1213
--card-offset: 1rem;
1314
--card-shadow: unset;
1415
--card-padding: 1rem;
15-
--gap: 1rem;
1616
--offset-left: 0;
1717
--offset-right: 5rem;
18-
19-
position: relative;
18+
--gap: 1rem;
2019
}
2120

2221
.timeline {
@@ -45,6 +44,7 @@
4544

4645
.timeline__items-container {
4746
display: flex;
47+
padding-block: var(--line-overhang);
4848
flex-direction: column;
4949
gap: var(--gap);
5050
flex: 1;

src/components/Timeline.stories.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ export const SpacingOptions: StoryObj<typeof Timeline> = {
169169
pointer: {
170170
offset: '4rem',
171171
},
172+
line: {
173+
overhang: '4rem',
174+
},
172175
},
173176
minMarkerGap: 150,
174177
},

src/models/style.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export type StyleConfig = {
44
line?: {
55
width?: string;
66
color?: string;
7+
overhang?: string;
78
};
89
gap?: string;
910
offset?: {

0 commit comments

Comments
 (0)