Skip to content

Commit a2433ba

Browse files
committed
fix(scroll): always show timeline line
1 parent f0709f4 commit a2433ba

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

src/components/common/list/ListItem.vue

+24-13
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ const props = defineProps({
1818
type: Number,
1919
required: true,
2020
},
21+
size: {
22+
type: Number,
23+
required: true,
24+
},
2125
poster: {
2226
type: String,
2327
required: false,
@@ -193,7 +197,8 @@ const loading = computed(() => props.item.loading);
193197
}
194198
195199
.year {
196-
color: var(--n-meta-text-color);
200+
margin-top: 0.25rem;
201+
opacity: 0.5;
197202
}
198203
199204
.loading {
@@ -234,37 +239,43 @@ const loading = computed(() => props.item.loading);
234239
<style lang="scss">
235240
/* stylelint-disable selector-class-pattern -- library class name */
236241
237-
.timeline-item.n-timeline-item .n-timeline-item-content .n-timeline-item-content__meta {
238-
margin: 0;
239-
}
240-
241-
.n-timeline.n-timeline--left-placement {
242-
.timeline-item.n-timeline-item .n-timeline-item-timeline {
242+
.n-timeline.n-timeline--left-placement .timeline-item.n-timeline-item {
243+
.n-timeline-item-timeline {
243244
--n-icon-size: 12px;
244245
245246
top: calc(0% - var(--n-icon-size) / 2);
246247
}
247248
248-
.timeline-item.no-header.n-timeline-item .n-timeline-item-timeline {
249-
.n-timeline-item-timeline__line {
249+
&.no-header .n-timeline-item-timeline {
250+
&__line {
250251
top: 0;
251252
}
252253
253-
.n-timeline-item-timeline__circle {
254+
&__circle {
254255
display: none;
255256
}
256257
}
257258
258-
.timeline-item.n-timeline-item .n-timeline-item-content {
259+
&:last-child .n-timeline-item-timeline {
260+
&__line {
261+
display: block;
262+
}
263+
}
264+
265+
.n-timeline-item-content {
259266
margin-left: calc(var(--n-icon-size) + 0.125rem);
260267
border-top: 1px solid transparent;
261268
262-
.n-timeline-item-content__title {
269+
&__meta {
270+
margin: 0;
271+
}
272+
273+
&__title {
263274
margin: 0;
264275
}
265276
}
266277
267-
.timeline-item.n-timeline-item:not(.no-header) .n-timeline-item-content {
278+
&:not(.no-header) .n-timeline-item-content {
268279
border-top: 1px solid var(--border-grey);
269280
}
270281
}

src/components/common/list/ListScroll.vue

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ const onHover = ({ item, hover }: { item: ListScrollItem; hover: boolean }) => {
9797
<ListItem
9898
:item="item"
9999
:index="item.index"
100+
:size="items.length"
100101
:hide-date="hideDate"
101102
:hover="hoverDate === item.date?.current?.toDateString()"
102103
@on-hover="onHover"

0 commit comments

Comments
 (0)