How to Update an Element Class when Sticky with Alpine JS
Sadly this doesn't work in the preview due to it using the website viewport, not the <iframe>
viewport. However, if you go to the component code used for the preview you will see it working.