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

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