W3C home > Mailing lists > Public > www-style@w3.org > July 2013

Re: specifying position:sticky

From: Simon Fraser <smfr@me.com>
Date: Sat, 13 Jul 2013 14:15:41 -0700
Cc: Corey Ford <cford@mozilla.com>, "www-style@w3.org" <www-style@w3.org>
Message-id: <7BF8A309-7B17-432F-99B0-0327C9E0665F@me.com>
To: Brad Kemper <brad.kemper@gmail.com>
On Jul 13, 2013, at 1:49 PM, Brad Kemper <brad.kemper@gmail.com> wrote:

> On Jul 13, 2013, at 12:48 PM, Corey Ford wrote:
> 
>> No, the opposite edge of the containing block is what limits the repositioning. To take a concrete example, such as sticky-top section headers [1], the headers stay 10px from the top of the viewport until their bottom edge reaches the *bottom* of their containing block, at which point they start scrolling with the document again. (Note that sticky-top only ever moves an element down.)
> 
> Ah, OK, I see what you're saying. So the bottom of the container will push the top off the screen once it no longer fits in the container without scrolling them both.
> 
> Is there also going to be something like on the iPhone Contacts app aphabetic list headings, where two items with the same sticky positioning will push on each other as their container is scrolled, so that they do not overlap? I hope so, as that is a very useful effect.

We deliberately avoided this behavior for sticky, because you get into having to decide when things overlap, which, if they have different X offsets, is not clear. We didnít want to have to code up something as complex as float avoidance behavior.

You can achieve the iPhone contacts behavior by simply putting each letter category in its own container, and put the sticky header for each in that container. Itís quite natural.

Simon


Received on Saturday, 13 July 2013 21:15:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:32 UTC