Skip to content

Commit

Permalink
💄 fix for broken pin style (#2889)
Browse files Browse the repository at this point in the history
* 💄 fix for broken pin style

As content (Rows) grows, the pin would get pushed down (and under) the content.

* changeset

* 💄 make css for timeline pin even more compact
  • Loading branch information
JulianNymark authored Apr 29, 2024
1 parent bac48d9 commit b21015b
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/selfish-poems-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-css": patch
---

:lipstick: tweak CSS for timeline pins.
2 changes: 1 addition & 1 deletion @navikt/core/css/timeline.css
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
.navds-timeline__pin-wrapper::before {
content: "";
top: var(--navdsc-timeline-pin-size);
height: calc(88% - var(--navdsc-timeline-pin-size));
height: calc(100% - var(--navdsc-timeline-pin-size) * 2);
width: 1px;
margin: 0 auto;
background: var(--a-surface-inverted);
Expand Down
70 changes: 70 additions & 0 deletions @navikt/core/react/src/timeline/timeline.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,76 @@ export const WithPins = () => {
})}
</Timeline.Row>
</Timeline>
<div style={{ height: "8rem" }} />
<Timeline>
<Timeline.Pin date={new Date("Apr 15 2022")}>Pin 1</Timeline.Pin>
<Timeline.Pin date={new Date("Jun 12 2022")}>Pin 2</Timeline.Pin>
<Timeline.Pin date={new Date("Jul 28 2022")}>Pin 3</Timeline.Pin>
<Timeline.Row
label="Row 1"
icon={<CheckmarkCircleFillIcon aria-hidden />}
>
{row1.map((p: any) => {
return (
<Timeline.Period
key={p.id}
start={p.start}
end={p.end}
status={p.status}
icon={p.icon}
/>
);
})}
</Timeline.Row>
<Timeline.Row
label="Row 2"
icon={<CheckmarkCircleFillIcon aria-hidden />}
>
{row2.map((p: any) => {
return (
<Timeline.Period
key={p.id}
start={p.start}
end={p.end}
status={p.status}
icon={p.icon}
/>
);
})}
</Timeline.Row>
<Timeline.Row
label="Row 2"
icon={<CheckmarkCircleFillIcon aria-hidden />}
>
{row2.map((p: any) => {
return (
<Timeline.Period
key={p.id}
start={p.start}
end={p.end}
status={p.status}
icon={p.icon}
/>
);
})}
</Timeline.Row>
<Timeline.Row
label="Row 2"
icon={<CheckmarkCircleFillIcon aria-hidden />}
>
{row2.map((p: any) => {
return (
<Timeline.Period
key={p.id}
start={p.start}
end={p.end}
status={p.status}
icon={p.icon}
/>
);
})}
</Timeline.Row>
</Timeline>
</div>
);
};
Expand Down

0 comments on commit b21015b

Please sign in to comment.