Skip to main content
cngx-src documentation

injectStepperCollapse

Functioncommon/stepper

projects/common/stepper/display-mode.ts

Description#

Reads the stepper's collapse flag off its own container.

The threshold is a @container rule in stepper-base.css writing --cngx-stepper-collapse onto .cngx-stepper::after. It lands on the pseudo-element because a container query cannot style its own container, and the query container for a pseudo-element is selected from its originating element's inclusive ancestors. Nothing here parses a width, so a consumer re-aims the collapse with a plain CSS rule.

Requires an injection context - it observes through injectContainerSize, so the observer is scoped to the caller's DestroyRef. A field initialiser on the stepper component is one; a bare call from a lifecycle hook is not.

Signature#

injectStepperCollapse(host: Element)

Parameters#

@paramhostElement

The <cngx-stepper> host element, which is its own container.

Returns#

Signal