Skip to content

Commit ce58827

Browse files
committed
feat(timeline): new syntax for timeline cols
1 parent a014cbb commit ce58827

File tree

1 file changed

+35
-11
lines changed

1 file changed

+35
-11
lines changed

src/core/components/timeline/timeline.less

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ each(@breakpoints, {
253253

254254
.timeline-item-content {
255255
padding: var(--f7-timeline-horizontal-item-padding);
256-
height: calc(100% - var(--f7-timeline-horizontal-item-padding));
256+
height: calc(100vw - var(--f7-timeline-horizontal-item-padding));
257257
.scrollable();
258258
margin: 0;
259259
}
@@ -264,21 +264,45 @@ each(@breakpoints, {
264264
.timeline-month:last-child .timeline-item:last-child {
265265
.hairline-remove(right);
266266
}
267-
268-
@cols: 5, 10, 15, 20, 25, 30, 100/3, 35, 40, 45, 50, 55, 60, 65, 100 * (2/3), 70, 75, 80, 85, 90,
269-
95, 100;
267+
@cols: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
270268
each(@cols, {
271269
@className: floor((@value));
272-
&.col-@{className} .timeline-item {
273-
width: ~"@{value}vw";
270+
&.timeline-cols-@{className} .timeline-item {
271+
width: ~"calc(100vw / @{value})";
274272
}
275273
});
276-
277-
@media (min-width: 768px) {
274+
@media (min-width: @breakpoints[xsmall]) {
275+
each(@cols, {
276+
&.xsmall-timeline-cols-@{value} .timeline-item {
277+
width: ~"calc(100vw / @{value})";
278+
}
279+
});
280+
}
281+
@media (min-width: @breakpoints[small]) {
282+
each(@cols, {
283+
&.small-timeline-cols-@{value} .timeline-item {
284+
width: ~"calc(100vw / @{value})";
285+
}
286+
});
287+
}
288+
@media (min-width: @breakpoints[medium]) {
289+
each(@cols, {
290+
&.medium-timeline-cols-@{value} .timeline-item {
291+
width: ~"calc(100vw / @{value})";
292+
}
293+
});
294+
}
295+
@media (min-width: @breakpoints[large]) {
296+
each(@cols, {
297+
&.large-timeline-cols-@{value} .timeline-item {
298+
width: ~"calc(100vw / @{value})";
299+
}
300+
});
301+
}
302+
@media (min-width: @breakpoints[xlarge]) {
278303
each(@cols, {
279-
@className: floor((@value));
280-
&.tablet-@{className} .timeline-item {
281-
width: ~"@{value}vw";
304+
&.xlarge-timeline-cols-@{value} .timeline-item {
305+
width: ~"calc(100vw / @{value})";
282306
}
283307
});
284308
}

0 commit comments

Comments
 (0)