Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Manually verify every consumer app when switching a shared component from JS-forced fixed positioning to CSS position: sticky
Validate each affected consumer when adopting position:sticky, using actual ancestor/layout constraints and browser scrolling tests where feasible.
Bad example
| 1 | /* shared header component, used by 4+ separate apps */ |
| 2 | .header { |
| 3 | position: sticky; |
| 4 | top: 0; |
| 5 | } |
| 6 | /* JS fallback that used to force `position: fixed` regardless of ancestor styles was removed */ |
Explanation (EN)
A shared sticky element can bind to an unintended scroll container in one consumer.
Objašnjenje (HR)
Zajednički sticky element kod jednog potrošača može pratiti pogrešan scroll container.
Good example
| 1 | // For each supported consumer, identify the scroll container and sticky inset. |
| 2 | // Scroll past the activation point and assert the element stays at that inset. |
| 3 | // Record automated coverage and manually checked remaining integrations. |
Explanation (EN)
Geometry-based browser tests can catch sticky regressions; manual checks cover integrations not represented in those tests.
Objašnjenje (HR)
Browser testovi geometrije mogu otkriti sticky regresije. Ručne provjere pokrivaju integracije koje ti testovi ne predstavljaju.
Notes (EN)
When replacing a positioning implementation with sticky, inspect each supported consumer's scroll ancestor, containing block, available scroll range and inset, then test representative scrolling behavior.
Bilješke (HR)
Pri zamjeni pozicioniranja sa sticky provjeri svakog podržanog potrošača: scroll pretka, containing block, raspoloživ raspon pomicanja i inset. Zatim testiraj reprezentativno pomicanje.
Exceptions / Tradeoffs (EN)
Overflow can change the sticky scroll container rather than universally disable sticky; transform/filter do not inherently break it. Browser layout/scroll tests can automate checks, with manual verification for uncovered integrations.