gss / engine

GSS engine
http://gss.github.io
MIT License
2.86k stars 105 forks source link

Is there a way to reference the viewport's position? #214

Open gabeblackbeard opened 8 years ago

gabeblackbeard commented 8 years ago

It appears "position: fixed" doesn't work in GSS as it did in regular CSS. I've made a header that I need to be at the top of the window, always, and it makes full use of GSS to center buttons, logo etc. Is there any property I can use that would take into account the scroll position of the viewport?

Inviz commented 8 years ago

$scroll-top

gabeblackbeard commented 8 years ago

Thank you a ton for the reply! It seems there's some lag associated with it though, as sometimes when I scroll the window down and up, the header moves out of position for a few miliseconds. Is there really no way to perfectly reproduce the effect one would get with "position: fixed" in regular css? How would a gss user make one of those headers that stick to the top of the window?

kkirby commented 6 years ago

Late reply. Calculating constraints on the fly at 60fps is not exactly something that can be done with just JavaScript. Maybe this library can we re-written in WebAssembly to gain better performance.