position: sticky, and the ancestor that silently disables it

position: sticky works or does nothing, with no error and no warning. Nearly always the cause is an ancestor rather than the element itself.

.sidebar { position: sticky; top: 1rem; }

/* any of these on an ancestor stops it: */
.parent { overflow: hidden; }   /* or auto, or scroll */
.parent { display: flex; }      /* if the item stretches, there is no room */
/* and the element must have a threshold — top/bottom/left/right */

The overflow rule is the one that catches everyone, because overflow: hidden is often added elsewhere to clear floats and has nothing to do with the sticky element. Sticky is also constrained to its parent, so it stops moving at the parent’s edge rather than the viewport’s. Browser support is decent this year but not universal, so it must degrade to static acceptably.