W3C home > Mailing lists > Public > www-style@w3.org > December 2016

Re: [css3-selectors]: Proposal: :in-view() selector for better visibility control

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 6 Dec 2016 09:45:10 -0800
Message-ID: <CAAWBYDC=QrCcWphfagZu7Pw03yytz9AEXWP39sjsX+cZJv_B2w@mail.gmail.com>
To: Alexander Shpack <shadowkin@gmail.com>
Cc: Andrea Rendine <master.skywalker.88@gmail.com>, www-style <www-style@w3.org>
On Tue, Dec 6, 2016 at 3:33 AM, Alexander Shpack <shadowkin@gmail.com> wrote:
> On Tue, Dec 6, 2016 at 12:30 PM, Andrea Rendine
> <master.skywalker.88@gmail.com> wrote:
>>
>> > Could you explain how it possible?
>>
>> I think this could be a basic example.
>> div:in-view(all) {
>>   height: 1000px;
>>   /* or an equivalent property incrementing vertical dimension of the
>> element */
>> }
>> div:in-view(partial), div:in-view(none) {
>>   height: auto;
>>   /* reverting to a normal dimension */
>> }
>> /* this case could also be div:not(:in-view(partial)) */
>>
>> So:
>> 1. the element is fully visible, its height is increased.
>>
>
> Stop execution. On this frame all other styles shouldn't be applied.

This is the solution that everybody reaches for when they're
suggesting something circular, and unfortunately, it doesn't work. ^_^

Not applying any other styles would in most cases totally break the
page's styling. You can't even just limit it to the elements getting
styled by that rule, as their sizes/positions can be affected by other
elements on the page.  It also breaks the fundamental model of CSS,
that it's a declarative model and ordering has almost no effect.

~TJ
Received on Tuesday, 6 December 2016 17:46:03 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 December 2016 17:46:04 UTC