position: sticky
breaks inside luxy.js because it uses transformed scroll containers.position: fixed
, or excluding elements from luxy.js scrolling using data-luxy-el="fixed"
.If the CSS position: sticky
is not working in your Webflow project and you're using luxy.js for smooth scrolling, the issue is likely due to how luxy.js manipulates the DOM and scroll behavior.
Here's how to resolve it:
position: sticky
and luxy.jsposition: sticky
will not work because the scroll container is not the default body
or html
—it's a transformed element, which breaks sticky positioning.#luxy
or .luxy-wrap
) and transforms it (e.g., using transform: translateY(...)
), then sticky
becomes ineffective inside it.#luxy
or .luxy-wrap
) and inspect whether it has a CSS transform
applied.Option 1: Avoid Using position: sticky
inside luxy scroll area
Either move the sticky element outside the .luxy
wrapper, so it stays on the native scroll context.
This lets sticky
function as expected.
Option 2: Replace position: sticky
with position: fixed
as a workaround
You can mimic sticky behavior by setting your element to position: fixed
and adding custom logic (e.g., JavaScript) to control when it's visible or pinned.
This is more complex but works within luxy.js scroll setups.
Option 3: Disable Smooth Scrolling on Specific Sections
Modify luxy.js to exclude certain elements from its smooth scroll behavior by marking them with data-luxy-el="fixed"
or similar.
This keeps parts of the page in the regular scroll flow, allowing sticky
to work inside them.
transform
styles applied by luxy.js..luxy
wrapper by:Sticky positioning doesn't work inside luxy.js's custom scroll areas because of transformed containers. To fix this, either place sticky elements outside of the smooth scroll area, mimic sticky behavior with position: fixed
, or configure luxy.js to exclude certain sections from being transformed.