W3C home > Mailing lists > Public > www-style@w3.org > September 2012

Re: Sticky Positioning

From: Ryan Seddon <seddon.ryan@gmail.com>
Date: Thu, 6 Sep 2012 13:39:02 +1000
Message-ID: <CADsa-VdAgi1mE4E0870+TxRLHK+bFrVAc=03bAoRqENxbXnbpg@mail.gmail.com>
To: Simon Fraser <smfr@me.com>
Cc: "www-style@w3.org" <www-style@w3.org>
> I agree with Brian this should be a media query and not a CSS value
> extension to position.
> A scroll position media query gives you much greater control over what an
> element should do when a certain scroll position is met.
> One use case would be creating a slim lined version of your navigation
> once the user scroll past a certain point with this MQ it'd be very easy.
> Another off the top of my head is being able to use this within scrollable
> containers that have overflow: auto set.
> As well as having a scroll-top a scroll-left or better yet a scroll-start
> to factor in ltr/rtl layouts. I could then do AND/OR conditions for the
> scroll position for greater control.
> @media (scroll-top: 15px) and (scroll-start: 200px) {
>     // alter elements based on multiple scroll positions
> }
> I disagree on the scroll position media query approach here. It would
> require that any design change on the page that affects the scrolling
> constraints of a sticky element would have to be reflected in the media
> queries. Those scroll offsets would be mysterious values that will probably
> have to be determined by trial and error, and would probably be easily
> broken on the system of users who have a different default font size, or
> narrower browser window.

Yeah that makes sense position: sticky wins quite easily over what would be
a nightmare to maintain with a scroll MQ. However I still think a scroll MQ
has some merit and I will start a new discussion.

Received on Thursday, 6 September 2012 03:39:49 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:03 UTC