This rule reports asContainer() or asAnchor() in a style() call that does not
also attach the ref. The container or anchor applies only to an element that has
the ref, so without it, nothing happens.
Reported
const card = style.ref("card");
style(card.asContainer("inline-size"));missing-ref-attachment: ref `card` provider has no matching marker attachment in this style() callFixed
const card = style.ref("card");
style(card, card.asContainer("inline-size"));How to fix
Pass the ref and the method in the same style() call, as in the example.
positionAnchor() is not reported. The positioned element does not need the ref.
Rule settings
| Preset | Severity |
|---|---|
recommended | warn |
strict | deny |
stylistic | off |
Configure lint to change the severity or options.