Skip to content

Commit 0686f9e

Browse files
Merge f8e2e95 into d3c8fe2
2 parents d3c8fe2 + f8e2e95 commit 0686f9e

3 files changed

Lines changed: 500 additions & 36 deletions

File tree

packages/react/src/Timeline/Timeline.docs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@
6767
"props": []
6868
}
6969
]
70-
}
70+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Story-local styles for the Custom Event playground in Timeline.stories.tsx.
3+
*
4+
* The `LeftRailGutter` wrapper reserves horizontal whitespace to the left of the
5+
* timeline rail so toggling between `actorSize: 'small'` and `actorSize: 'large'`
6+
* does not horizontally shift the timeline. This mirrors the Rails ViewComponents
7+
* `.TimelineItem-avatar { position: absolute; left: -72px; }` treatment WITHOUT
8+
* adding a public avatar slot to Primer React's Timeline component (Phase 2 will
9+
* evaluate that API change).
10+
*/
11+
12+
.LeftRailGutter {
13+
/* Reserve enough room to the left of the rail for a 40px avatar plus a 16px gap. */
14+
padding-left: calc(var(--base-size-40) + var(--base-size-16));
15+
}
16+
17+
.LargeActorAvatar {
18+
position: absolute;
19+
/* Vertically centered with the 32px badge: badge top (16px padding) + 16px half = 32px center; avatar top = 32px - 20px (half avatar) = 12px. */
20+
top: var(--base-size-12);
21+
/* Matches Rails Timeline ViewComponents `.TimelineItem-avatar { left: -72px }`. */
22+
left: calc(-1 * (var(--base-size-40) + var(--base-size-32)));
23+
z-index: 1;
24+
}
25+
26+
.SmallActorAvatar {
27+
margin-right: var(--base-size-4);
28+
/* `vertical-align: middle` is more reliable than `text-bottom` for 20px avatars next
29+
to body text; the slight negative nudge optically aligns the avatar to the x-height. */
30+
vertical-align: middle;
31+
position: relative;
32+
/* stylelint-disable-next-line primer/spacing -- 1px optical nudge to align avatar with text x-height */
33+
top: -1px;
34+
}
35+
36+
.ActorName {
37+
font-weight: var(--base-text-weight-semibold);
38+
color: var(--fgColor-default);
39+
}
40+
41+
.AppName {
42+
font-weight: var(--base-text-weight-semibold);
43+
color: var(--fgColor-default);
44+
}
45+
46+
.AppAvatar {
47+
margin-right: var(--base-size-4);
48+
vertical-align: middle;
49+
position: relative;
50+
/* stylelint-disable-next-line primer/spacing -- 1px optical nudge to align avatar with text x-height */
51+
top: -1px;
52+
border-radius: var(--borderRadius-medium);
53+
}

0 commit comments

Comments
 (0)