Skip to content

Fix timeline line width break when size="lg" is set on individual item#2476

Merged
calebporzio merged 1 commit intomainfrom
josh/fix-timeline-line-break-per-item-size-lg
Mar 24, 2026
Merged

Fix timeline line width break when size="lg" is set on individual item#2476
calebporzio merged 1 commit intomainfrom
josh/fix-timeline-line-break-per-item-size-lg

Conversation

@joshhanley
Copy link
Member

@joshhanley joshhanley commented Mar 10, 2026

The Scenario

When using size="lg" on an individual flux:timeline.item, the timeline line becomes thicker (2px) at that item while surrounding items remain at 1px, creating a visible break in the line.

Screenshot 2026-03-10 at 01 13 42PM@2x
<flux:timeline>
    <flux:timeline.item>
        <flux:timeline.indicator>
            <flux:icon.tag variant="micro" />
        </flux:timeline.indicator>
        <flux:timeline.content>
            <flux:heading>Default item</flux:heading>
        </flux:timeline.content>
    </flux:timeline.item>

    <flux:timeline.item size="lg">
        <flux:timeline.indicator>
            <flux:icon.star variant="micro" />
        </flux:timeline.indicator>
        <flux:timeline.content>
            <flux:heading>Large item</flux:heading>
        </flux:timeline.content>
    </flux:timeline.item>
</flux:timeline>

The Problem

The CSS rule :where([data-flux-timeline-size="lg"]) sets --flux-timeline-line-width: 2px and --flux-timeline-line-gap: 0px. This selector matches any element with the attribute, including individual <li> items. When only one item has size="lg", its line segments inherit the thicker width while surrounding items stay at 1px.

The Solution

Split the CSS rule into two parts:

  • Line-related variables (--flux-timeline-line-width, --flux-timeline-line-gap) and timeline-level spacing (--flux-timeline-item-gap, --flux-timeline-content-gap) now use the more specific selector :where([data-flux-timeline][data-flux-timeline-size="lg"]), which only matches the <ol> wrapper.
  • The indicator size (--flux-timeline-indicator-size) remains on the broader :where([data-flux-timeline-size="lg"]) selector so it can still scale per-item.
Screenshot 2026-03-10 at 01 14 31PM@2x

Note: You will see in the fixed screenshot above the different line colours, that will be fixed in a Flux Pro PR https://github.com/livewire/flux-pro/pull/473.

Fixes #2473

@calebporzio calebporzio merged commit be919ac into main Mar 24, 2026
@calebporzio calebporzio deleted the josh/fix-timeline-line-break-per-item-size-lg branch March 24, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flux:timeline.indicator color ignored when status is set on flux:timeline.item, line break when using size="lg"

2 participants